修改参数名
This commit is contained in:
@@ -91,10 +91,10 @@ func (s *sSystemCron) AddCron(typ v1.CronType, _func func() error) {
|
|||||||
// @receiver s: sSystemCron的实例,代表一个调度系统。
|
// @receiver s: sSystemCron的实例,代表一个调度系统。
|
||||||
// @param typ: 任务的类型,决定该任务将被添加到哪个列表中。对应不同的时间间隔。
|
// @param typ: 任务的类型,决定该任务将被添加到哪个列表中。对应不同的时间间隔。
|
||||||
// @param _func: 要添加的任务函数,该函数执行时应该返回一个error。
|
// @param _func: 要添加的任务函数,该函数执行时应该返回一个error。
|
||||||
// @param _isMain: 是否只在主服务器上执行一次,true 唯一执行,false 全局执行不判断唯一
|
// @param _onlyMain: 是否只在主服务器上执行一次,true 唯一执行,false 全局执行不判断唯一
|
||||||
func (s *sSystemCron) AddCronV2(typ v1.CronType, _func func(context.Context) error, _isMain ...bool) {
|
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() {
|
if !g.Cfg().MustGet(gctx.New(), "game.cron_main").Bool() {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user