This commit is contained in:
邹宗楠
2022-10-22 22:44:39 +08:00
parent 04f1190953
commit 5a47102894
37 changed files with 4 additions and 115 deletions

View File

@@ -682,7 +682,6 @@ func ScheduleTimerFuncOnce(name string, handler func(interface{}), timeStr strin
now := time.Now()
nextTime := jxutils.GetNextTimeFromList(now, []string{timeStr})
duration := nextTime.Sub(now) + 1*time.Second
globals.SugarLogger.Debugf("ScheduleTimerFuncOnce, func:%s, duration:%v", name, duration)
utils.AfterFuncWithRecover(duration, func() {
globals.SugarLogger.Debugf("ScheduleTimerFuncOnce func:%s", name)
handler(param)
@@ -690,7 +689,6 @@ func ScheduleTimerFuncOnce(name string, handler func(interface{}), timeStr strin
}
func ScheduleTimerFuncByInterval(handler func(), delay, inerval time.Duration) {
globals.SugarLogger.Debugf("ScheduleTimerFuncByInterval, delay:%v, inerval:%v", delay, inerval)
utils.AfterFuncWithRecover(delay, func() {
beginTime := time.Now()
handler()