Browse Source

fix cron continuous error job

pull/43/head
yedf2 5 years ago
parent
commit
baa4547ecf
  1. 7
      dtmsvr/cron.go

7
dtmsvr/cron.go

@ -14,17 +14,18 @@ import (
var CronForwardDuration time.Duration = time.Duration(0)
// CronTransOnce cron expired trans. use expireIn as expire time
func CronTransOnce() bool {
func CronTransOnce() (hasTrans bool) {
defer handlePanic(nil)
trans := lockOneTrans(CronForwardDuration)
if trans == nil {
return false
return
}
hasTrans = true
if TransProcessedTestChan != nil {
defer WaitTransProcessed(trans.Gid)
}
trans.Process(dbGet(), true)
return true
return
}
// CronExpiredTrans cron expired trans, num == -1 indicate for ever

Loading…
Cancel
Save