mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
修复crontab定时器释放不完整问题
This commit is contained in:
@@ -194,7 +194,6 @@ func (slf *Module) CronFunc(cronExpr *timer.CronExpr, cb func()) *timer.Cron {
|
|||||||
|
|
||||||
cron := slf.dispatcher.CronFuncEx(cronExpr, func(cron *timer.Cron) {
|
cron := slf.dispatcher.CronFuncEx(cronExpr, func(cron *timer.Cron) {
|
||||||
cb()
|
cb()
|
||||||
delete(slf.mapActiveCron,cron)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
slf.mapActiveCron[cron] = nil
|
slf.mapActiveCron[cron] = nil
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ func (t *Timer) Cb() {
|
|||||||
|
|
||||||
if t.cbex!=nil {
|
if t.cbex!=nil {
|
||||||
t.cbex(t)
|
t.cbex(t)
|
||||||
}else{
|
}else if t.cb!= nil {
|
||||||
t.cb()
|
t.cb()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user