From 7f61fe29da036535a2d750117309992b4d4acc86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=AC=A2?= Date: Tue, 1 Dec 2026 13:36:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=AE=A2=E5=8D=95=E9=80=9A=E7=9F=A5):=20?= =?UTF-8?q?=E5=86=BB=E7=BB=93=E6=89=B9=E6=AC=A1=E5=85=81=E8=AE=B8=205=20?= =?UTF-8?q?=E7=A7=92=E5=87=86=E5=A4=87=E5=81=8F=E5=B7=AE=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=95=B4=E6=89=B9=E6=9C=AA=E5=8F=91=E9=80=81=E5=90=8E?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调度在截止后 60 秒窗口内冻结时,实际写入时间可能比 cutoff+60s 晚几百毫秒 - 发送前校验用 createdAt > cutoff+60s 直接跳过,导致三个批次整批不发,30 分钟后按队列超时取消 - 增加 5 秒容差,仅影响冻结批次的可发送判定,不改变采集窗口 --- src/modules/order-rules/dispatcher.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/order-rules/dispatcher.cjs b/src/modules/order-rules/dispatcher.cjs index fc8c001..757a0ca 100644 --- a/src/modules/order-rules/dispatcher.cjs +++ b/src/modules/order-rules/dispatcher.cjs @@ -65,7 +65,7 @@ class OrderRuleDispatcher{ const legacyStart=new Date(Date.parse(batch.cutoff)+8*3600000).toISOString().slice(0,10)+'T00:00:00+08:00'; if(!batch.window||batch.window.end!==expected.end||![Date.parse(expected.start),Date.parse(legacyStart)].includes(Date.parse(batch.window.start))||batch.window.startInclusive!==true||batch.window.endInclusive!==false)continue; const grace=batch.intakeGrace?.cutoff===batch.cutoff&&Date.parse(batch.intakeGrace.expiresAt)===Date.parse(batch.cutoff)+1800000&&Date.parse(batch.createdAt)<=Date.parse(batch.intakeGrace.expiresAt)&&batch.orderIds?.every(id=>{const order=this.store.get('orders',id);return order&&(this.store.intakeWindow(order.sample||order.event)?.end===batch.cutoff||require('./carry-forward.cjs').windowForOrder(this.store,order,modeOf(batch))?.end===batch.cutoff);}); - if(batch.createdAt&&(Date.parse(batch.createdAt)>Date.parse(batch.cutoff)+60000&&!grace||Date.parse(batch.createdAt)Date.parse(batch.cutoff)+60000+prepareSkewMs&&!grace||Date.parse(batch.createdAt)60000)this.schedule={signature,next:nextSlots(schedule,this.clock(),1,calendar)[0]};