计划任务修改,act与kv使用协程方式执行,不影响其他任务

This commit is contained in:
ayflying
2025-09-01 18:12:58 +08:00
parent 95539038c0
commit 50cfc23ad2
6 changed files with 31 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
package gameKv
import (
"context"
"errors"
"fmt"
"strconv"
@@ -39,7 +40,7 @@ func init() {
// @Description: 保存用户KV数据列表。
// @receiver s: sGameKv的实例。
// @return err: 错误信息如果操作成功则为nil。
func (s *sGameKv) SavesV1() (err error) {
func (s *sGameKv) SavesV1(ctx context.Context) (err error) {
// 最大允许执行时间
RunTimeMax = gtime.Now().Add(time.Minute * 30)
g.Log().Debug(ctx, "开始执行游戏kv数据保存")