修改参数名

This commit is contained in:
ayflying
2025-08-22 14:31:57 +08:00
parent 42535d0023
commit 2193a42703

View File

@@ -91,10 +91,10 @@ func (s *sSystemCron) AddCron(typ v1.CronType, _func func() error) {
// @receiver s: sSystemCron的实例代表一个调度系统。
// @param typ: 任务的类型,决定该任务将被添加到哪个列表中。对应不同的时间间隔。
// @param _func: 要添加的任务函数该函数执行时应该返回一个error。
// @param _isMain: 是否只在主服务器上执行一次,true 唯一执行false 全局执行不判断唯一
func (s *sSystemCron) AddCronV2(typ v1.CronType, _func func(context.Context) error, _isMain ...bool) {
// @param _onlyMain: 是否只在主服务器上执行一次,true 唯一执行false 全局执行不判断唯一
func (s *sSystemCron) AddCronV2(typ v1.CronType, _func func(context.Context) error, _onlyMain ...bool) {
//如果传过来的任务是需要主服务器执行一次
if len(_isMain) > 0 && _isMain[0] {
if len(_onlyMain) > 0 && _onlyMain[0] {
//判断当前是否为主服务器
if !g.Cfg().MustGet(gctx.New(), "game.cron_main").Bool() {
return