Browse Source

feat:最新标讯缓存

wangshan 1 năm trước cách đây
mục cha
commit
3f37549c9a
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      jyBXBase/rpc/model/newestBidding.go

+ 6 - 3
jyBXBase/rpc/model/newestBidding.go

@@ -282,19 +282,22 @@ func GetRedisKeyTimeout(status int, positionId int64) config.CacheConfig {
 	switch status {
 	case StatusNoLogin:
 		redisKey = IC.C.NewsCache.NoLogin.Key
-		redisKey = fmt.Sprintf(redisKey, time.Now().Year(), time.Now().Month(), time.Now().Day())
+		//redisKey = fmt.Sprintf(redisKey, time.Now().Year(), time.Now().Month(), time.Now().Day())
+		redisKey = fmt.Sprintf(redisKey, time.Now().Year(), 8, 8) //最开始逻辑是每日更新---》每7天更新一次;不麻烦改配置,就改代码默认月份是8 日期是8
 		timeOut = IC.C.NewsCache.NoLogin.Timeout
 		cuKey = fmt.Sprintf("%s_%s", redisKey, IC.C.NewsCache.NoLogin.CacheUpdateKey)
 		cuTimeOut = IC.C.NewsCache.NoLogin.CacheUpdateTimeout
 	case StatusLoginUser:
 		redisKey = IC.C.NewsCache.LoginUser.Key // 登录用户使用的缓存key
-		redisKey = fmt.Sprintf(redisKey, positionId, time.Now().Year(), time.Now().Month(), time.Now().Day())
+		//redisKey = fmt.Sprintf(redisKey, positionId, time.Now().Year(), time.Now().Month(), time.Now().Day())
+		redisKey = fmt.Sprintf(redisKey, positionId, time.Now().Year(), 8, 8) //
 		timeOut = IC.C.NewsCache.LoginUser.Timeout
 		cuKey = fmt.Sprintf("%s_%s", redisKey, IC.C.NewsCache.LoginUser.CacheUpdateKey)
 		cuTimeOut = IC.C.NewsCache.LoginUser.CacheUpdateTimeout
 	case StatusLogin:
 		redisKey = IC.C.NewsCache.Login.Key // 登录用户使用的最新标讯缓存key
-		redisKey = fmt.Sprintf(redisKey, time.Now().Year(), time.Now().Month(), time.Now().Day())
+		//redisKey = fmt.Sprintf(redisKey, time.Now().Year(), time.Now().Month(), time.Now().Day())
+		redisKey = fmt.Sprintf(redisKey, time.Now().Year(), 8, 8) //
 		timeOut = IC.C.NewsCache.Login.Timeout
 		cuKey = fmt.Sprintf("%s_%s", redisKey, IC.C.NewsCache.Login.CacheUpdateKey)
 		cuTimeOut = IC.C.NewsCache.Login.CacheUpdateTimeout