- fix bug in resetTimer(wrong place for handling autoPickupTimeoutMinute > 1).
This commit is contained in:
@@ -547,6 +547,10 @@ func (s *DefScheduler) resetTimer(savedOrderInfo *WatchOrderInfo, bill *model.Wa
|
|||||||
s.stopTimer(savedOrderInfo)
|
s.stopTimer(savedOrderInfo)
|
||||||
}
|
}
|
||||||
if config != nil && config.TimeoutAction != nil && config.TimerType != scheduler.TimerTypeByPass {
|
if config != nil && config.TimeoutAction != nil && config.TimerType != scheduler.TimerTypeByPass {
|
||||||
|
// 对于自动拣货,以订单中的设置为准
|
||||||
|
if statusType == scheduler.TimerStatusTypeOrder && status == model.OrderStatusAccepted && savedOrderInfo.autoPickupTimeoutMinute > 1 {
|
||||||
|
config.Timeout = time.Duration(savedOrderInfo.autoPickupTimeoutMinute) * time.Minute
|
||||||
|
}
|
||||||
var timeout time.Duration
|
var timeout time.Duration
|
||||||
switch config.TimerType {
|
switch config.TimerType {
|
||||||
case scheduler.TimerTypeBaseNow:
|
case scheduler.TimerTypeBaseNow:
|
||||||
@@ -561,10 +565,6 @@ func (s *DefScheduler) resetTimer(savedOrderInfo *WatchOrderInfo, bill *model.Wa
|
|||||||
default:
|
default:
|
||||||
panic("TimerType is wrong!!!")
|
panic("TimerType is wrong!!!")
|
||||||
}
|
}
|
||||||
// 对于自动拣货,以订单中的设置为准
|
|
||||||
if statusType == scheduler.TimerStatusTypeOrder && status == model.OrderStatusAccepted && savedOrderInfo.autoPickupTimeoutMinute > 1 {
|
|
||||||
timeout = time.Duration(savedOrderInfo.autoPickupTimeoutMinute) * time.Minute
|
|
||||||
}
|
|
||||||
if config.TimeoutGap != 0 {
|
if config.TimeoutGap != 0 {
|
||||||
timeout += time.Duration(rand.Int31n(int32(config.TimeoutGap))) * time.Second
|
timeout += time.Duration(rand.Int31n(int32(config.TimeoutGap))) * time.Second
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user