去掉启动的缓存key
This commit is contained in:
@@ -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) {
|
func (s *sGameAct) Saves(ctx context.Context) (err error) {
|
||||||
getCache, _ := pkg.Cache("redis").Get(nil, "cron:game_act")
|
|
||||||
g.Log().Debug(ctx, "开始执行游戏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)
|
RunTimeMax = gtime.Now().Add(time.Minute * 30)
|
||||||
//遍历执行
|
//遍历执行
|
||||||
|
|||||||
@@ -45,14 +45,6 @@ func (s *sGameKv) SavesV1(ctx context.Context) (err error) {
|
|||||||
RunTimeMax = gtime.Now().Add(time.Minute * 30)
|
RunTimeMax = gtime.Now().Add(time.Minute * 30)
|
||||||
g.Log().Debug(ctx, "开始执行游戏kv数据保存")
|
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 {
|
type ListData struct {
|
||||||
Uid int64 `json:"uid"`
|
Uid int64 `json:"uid"`
|
||||||
|
|||||||
Reference in New Issue
Block a user