去掉启动的缓存key

This commit is contained in:
ayflying
2025-09-02 10:14:01 +08:00
parent cd3de96761
commit 8210ac24db
2 changed files with 0 additions and 14 deletions

View File

@@ -110,14 +110,8 @@ func (s *sGameAct) Set(uid int64, actId int, data interface{}) (err error) {
}
func (s *sGameAct) Saves(ctx context.Context) (err error) {
getCache, _ := pkg.Cache("redis").Get(nil, "cron:game_act")
g.Log().Debug(ctx, "开始执行游戏act数据保存了")
//如果没有执行过,设置时间戳
if getCache.Int64() > 0 {
return
} else {
pkg.Cache("redis").Set(nil, "cron:game_act", gtime.Now().Unix(), time.Hour)
}
// 最大允许执行时间
RunTimeMax = gtime.Now().Add(time.Minute * 30)
//遍历执行

View File

@@ -45,14 +45,6 @@ func (s *sGameKv) SavesV1(ctx context.Context) (err error) {
RunTimeMax = gtime.Now().Add(time.Minute * 30)
g.Log().Debug(ctx, "开始执行游戏kv数据保存")
getCache, err := pkg.Cache("redis").Get(nil, "cron:game_kv")
//如果没有执行过,设置时间戳
if getCache.Int64() > 0 {
return
} else {
pkg.Cache("redis").Set(nil, "cron:game_kv", gtime.Now().Unix(), time.Hour)
}
// 定义用于存储用户数据的结构体
type ListData struct {
Uid int64 `json:"uid"`