From baa4547ecf4c16d3d255d3564814a1defdecc0ab Mon Sep 17 00:00:00 2001 From: yedf2 <120050102@qq.com> Date: Fri, 15 Oct 2021 20:20:47 +0800 Subject: [PATCH] fix cron continuous error job --- dtmsvr/cron.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dtmsvr/cron.go b/dtmsvr/cron.go index 86cd0aa..8880511 100644 --- a/dtmsvr/cron.go +++ b/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