Skip to content

Commit

Permalink
修改配置数据缓存的时间
Browse files Browse the repository at this point in the history
  • Loading branch information
microrain authored and microrain committed Jan 30, 2023
1 parent b39f8a7 commit b6f85a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/logic/common/config_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/sagoo-cloud/sagooiot/internal/model/entity"
"github.com/sagoo-cloud/sagooiot/internal/service"
"github.com/sagoo-cloud/sagooiot/utility/liberr"
"time"
)

type sConfigData struct {
Expand Down Expand Up @@ -149,7 +150,8 @@ func (s *sConfigData) GetConfigByKey(ctx context.Context, key string) (config *e
return
}
if config != nil {
cache.Set(ctx, consts.CacheSysConfigTag+key, config, 0, consts.CacheSysConfigTag)
//配置数据缓存1分钟
cache.Set(ctx, consts.CacheSysConfigTag+key, config, time.Minute*1, consts.CacheSysConfigTag)
}
return
}
Expand Down

0 comments on commit b6f85a3

Please sign in to comment.