From 8210ac24dbc295886298d860ca31260706c3f4b4 Mon Sep 17 00:00:00 2001 From: ayflying Date: Tue, 2 Sep 2025 10:14:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=90=AF=E5=8A=A8=E7=9A=84?= =?UTF-8?q?=E7=BC=93=E5=AD=98key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/gameAct/gameAct.go | 6 ------ internal/logic/gameKv/gameKv.go | 8 -------- 2 files changed, 14 deletions(-) diff --git a/internal/logic/gameAct/gameAct.go b/internal/logic/gameAct/gameAct.go index 0cdb90c..3d7b2db 100644 --- a/internal/logic/gameAct/gameAct.go +++ b/internal/logic/gameAct/gameAct.go @@ -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) //遍历执行 diff --git a/internal/logic/gameKv/gameKv.go b/internal/logic/gameKv/gameKv.go index 7563ea5..64be563 100644 --- a/internal/logic/gameKv/gameKv.go +++ b/internal/logic/gameKv/gameKv.go @@ -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"`