用户信息缓存时间
This commit is contained in:
parent
be5accaa10
commit
478888b392
@ -55,7 +55,7 @@ func InitActionsCommonCache() {
|
|||||||
|
|
||||||
maxPostIdCache = cache.NewSliceCache[uint64](getMaxPostId, vars.Conf.MaxPostIdCacheTime)
|
maxPostIdCache = cache.NewSliceCache[uint64](getMaxPostId, vars.Conf.MaxPostIdCacheTime)
|
||||||
|
|
||||||
usersCache = cache.NewMapCacheByBatchFn[uint64, models.WpUsers](getUsers, time.Hour)
|
usersCache = cache.NewMapCacheByBatchFn[uint64, models.WpUsers](getUsers, vars.Conf.UserInfoCacheTime)
|
||||||
usersCache.SetCacheFunc(getUser)
|
usersCache.SetCacheFunc(getUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,3 +49,5 @@ maxRequestNum: 500
|
|||||||
singleIpSearchNum: 10
|
singleIpSearchNum: 10
|
||||||
# 文档最大id缓存时间
|
# 文档最大id缓存时间
|
||||||
maxPostIdCacheTime: 1h
|
maxPostIdCacheTime: 1h
|
||||||
|
# 用户信息缓存时间
|
||||||
|
userInfoCacheTime: 24h
|
||||||
|
@ -29,6 +29,7 @@ type Config struct {
|
|||||||
MaxRequestNum int64 `yaml:"maxRequestNum"`
|
MaxRequestNum int64 `yaml:"maxRequestNum"`
|
||||||
SingleIpSearchNum int64 `yaml:"singleIpSearchNum"`
|
SingleIpSearchNum int64 `yaml:"singleIpSearchNum"`
|
||||||
MaxPostIdCacheTime time.Duration `yaml:"maxPostIdCacheTime"`
|
MaxPostIdCacheTime time.Duration `yaml:"maxPostIdCacheTime"`
|
||||||
|
UserInfoCacheTime time.Duration `yaml:"userInfoCacheTime"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Mysql struct {
|
type Mysql struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user