- fix resetTimer error.
This commit is contained in:
@@ -352,7 +352,7 @@ func (s *DefScheduler) resetTimer(savedOrderInfo *WatchOrderInfo, statusType, st
|
||||
if config == nil || config.TimerType != scheduler.TimerTypeByPass {
|
||||
s.stopTimer(savedOrderInfo)
|
||||
}
|
||||
if config != nil && config.TimeoutAction != nil && config.TimerType != scheduler.TimerTypeNoTimer && config.TimerType != scheduler.TimerTypeByPass {
|
||||
if config != nil && config.TimeoutAction != nil && config.TimerType != scheduler.TimerTypeByPass {
|
||||
var timeout time.Duration
|
||||
switch config.TimerType {
|
||||
case scheduler.TimerTypeBaseNow:
|
||||
@@ -389,7 +389,7 @@ func (s *DefScheduler) resetTimer(savedOrderInfo *WatchOrderInfo, statusType, st
|
||||
}, order.VendorOrderID)
|
||||
})
|
||||
}
|
||||
globals.SugarLogger.Debugf("resetTimer orderID:%s, status:%d, timeout:%v", order.VendorOrderID, status, timeout)
|
||||
globals.SugarLogger.Debugf("resetTimer, orderID:%s, status:%d, timeout:%v", order.VendorOrderID, status, timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -433,13 +433,18 @@ func (s *DefScheduler) mergeOrderStatusConfig(statusType, status int, config *sc
|
||||
}
|
||||
retVal = &scheduler.StatusActionConfig{}
|
||||
if defConfig != nil {
|
||||
retVal.Timeout = defConfig.Timeout
|
||||
retVal.TimeoutAction = defConfig.TimeoutAction
|
||||
*retVal = *defConfig
|
||||
}
|
||||
if config != nil {
|
||||
if config.Timeout >= 0 {
|
||||
if config.Timeout != 0 {
|
||||
retVal.Timeout = config.Timeout
|
||||
}
|
||||
if config.TimerType != scheduler.TimerTypeNoOverride {
|
||||
retVal.TimerType = config.TimerType
|
||||
}
|
||||
if config.TimeoutGap != 0 {
|
||||
retVal.TimeoutGap = config.TimeoutGap
|
||||
}
|
||||
if config.TimeoutAction != nil {
|
||||
retVal.TimeoutAction = config.TimeoutAction
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user