- replace all goroutine and AfterFunc with recover version
This commit is contained in:
@@ -583,7 +583,7 @@ func (s *DefScheduler) swtich2SelfDeliverWithRetry(savedOrderInfo *WatchOrderInf
|
||||
if err := s.Swtich2SelfDeliver(order, ""); err != nil && err != scheduler.ErrOrderStatusAlreadySatisfyCurOperation {
|
||||
globals.SugarLogger.Infof("swtich2SelfDeliverWithRetry failed, bill:%v, err:%v", bill, err)
|
||||
if retryCount > 0 {
|
||||
time.AfterFunc(duration, func() {
|
||||
utils.AfterFuncWithRecover(duration, func() {
|
||||
jxutils.CallMsgHandlerAsync(func() {
|
||||
s.swtich2SelfDeliverWithRetry(savedOrderInfo, bill, retryCount-1, duration)
|
||||
}, order.VendorOrderID)
|
||||
@@ -724,7 +724,7 @@ func (s *DefScheduler) resetTimer(savedOrderInfo *WatchOrderInfo, bill *model.Wa
|
||||
}
|
||||
savedOrderInfo.timerStatusType = statusType
|
||||
savedOrderInfo.timerStatus = status
|
||||
savedOrderInfo.timer = time.AfterFunc(timeout, func() {
|
||||
savedOrderInfo.timer = utils.AfterFuncWithRecover(timeout, func() {
|
||||
jxutils.CallMsgHandlerAsync(func() {
|
||||
globals.SugarLogger.Debugf("fire timer:%s, orderID:%s", timerName, order.VendorOrderID)
|
||||
config.TimeoutAction(savedOrderInfo)
|
||||
|
||||
Reference in New Issue
Block a user