diff --git a/modules/timer/caravanrank.go b/modules/timer/caravanrank.go index 965d2ddf0..dec8c111d 100644 --- a/modules/timer/caravanrank.go +++ b/modules/timer/caravanrank.go @@ -68,21 +68,20 @@ func (this *CaravanRank) GetGlobalConf() *cfg.GameGlobalData { func (this *CaravanRank) Start() (err error) { err = this.MCompModel.Start() opentime := this.service.GetOpentime().Unix() - this.module.Debugf("%d", opentime) + //cron.AddFunc("30 10 1 * * ?", this.TimerSeason) - this.module.Debugf("--%d", time.Now().Unix()) - seasonTime := this.GetGlobalConf().BusinessRewardday + //seasonTime := this.GetGlobalConf().BusinessRewardday * 24 * 3600 if configure.Now().Unix() < opentime { // 开服时间是未来可能存在问题 return } - subTime := int32(configure.Now().Unix() - opentime) - if subTime < seasonTime { - this.cTimerObj = timewheel.Add(time.Second*time.Duration(subTime), this.TimerSeason, nil) - } else { - s := configure.Now().Unix() - (configure.Now().Unix()-opentime)%int64(subTime) + int64(seasonTime) - this.cTimerObj = timewheel.Add(time.Second*time.Duration(s), this.TimerSeason, nil) - } + // subTime := int32(configure.Now().Unix() - opentime) + // if subTime < seasonTime { + // this.cTimerObj = timewheel.Add(time.Second*time.Duration(subTime), this.TimerSeason, nil) + // } else { + // s := configure.Now().Unix() - (configure.Now().Unix()-opentime)%int64(subTime) + int64(seasonTime) + // this.cTimerObj = timewheel.Add(time.Second*time.Duration(s), this.TimerSeason, nil) + // } return } diff --git a/services/mainte/main.go b/services/mainte/main.go index 67fc17086..a8e4bd3f3 100644 --- a/services/mainte/main.go +++ b/services/mainte/main.go @@ -8,14 +8,12 @@ import ( "go_dreamfactory/modules/web" "go_dreamfactory/services" "go_dreamfactory/sys/db" - "time" "go_dreamfactory/lego" "go_dreamfactory/lego/base/rpcx" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/cron" "go_dreamfactory/lego/sys/log" - "go_dreamfactory/lego/sys/timewheel" ) /* @@ -65,11 +63,11 @@ func (this *Service) InitSys() { log.Infof("init sys.cron success!") } //定时系统 秒级时间轮 - if err := timewheel.OnInit(nil, timewheel.SetTick(time.Second)); err != nil { - panic(fmt.Sprintf("init sys.timewheel err: %s", err.Error())) - } else { - log.Infof("init sys.timewheel success!") - } + // if err := timewheel.OnInit(nil, timewheel.SetTick(time.Second)); err != nil { + // panic(fmt.Sprintf("init sys.timewheel err: %s", err.Error())) + // } else { + // log.Infof("init sys.timewheel success!") + // } //存储系统 if err := db.OnInit(this.GetSettings().Sys["db"]); err != nil { panic(fmt.Sprintf("init sys.db err: %s", err.Error()))