From 976fa522e708fec0f568c7ca22f38316fadd1c8b Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 10 Jun 2019 14:21:19 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E7=A1=AE=E4=BF=9DTimeoutGap=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4TIMER=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/scheduler/defsch/defsch.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index 5b06c63a9..5bd0eba17 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -840,10 +840,15 @@ func (s *DefScheduler) mergeOrderStatusConfig(savedOrderInfo *WatchOrderInfo, st } } } else { // 有最后拣货时间,反推 + aHead := time2AutoPickupAhead + second2AutoPickupGap*time.Second + realSecond2AutoPickupGap := second2AutoPickupGap + if realSecond2AutoPickupGap > int(aHead/time.Second) { + realSecond2AutoPickupGap = int(aHead / time.Second) + } vendorActionParams = &partner.StatusActionParams{ TimerType: partner.TimerTypeBaseNow, - Timeout: order.PickDeadline.Sub(time.Now()) - time2AutoPickupAhead - second2AutoPickupGap*time.Second, - TimeoutGap: second2AutoPickupGap, + Timeout: order.PickDeadline.Sub(time.Now()) - aHead, + TimeoutGap: realSecond2AutoPickupGap, } } }