fix: advance exact-boundary every schedules · openclaw/openclaw@e2c9c06
steipete
·
2026-06-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -99,6 +99,13 @@ describe("cron schedule", () => {
|
99 | 99 | expect(next).toBe(anchor + 30_000); |
100 | 100 | }); |
101 | 101 | |
| 102 | +it("advances when now matches a later every interval boundary", () => { |
| 103 | +const anchor = Date.parse("2025-12-13T00:00:00.000Z"); |
| 104 | +const now = anchor + 30_000; |
| 105 | +const next = computeNextRunAtMs({ kind: "every", everyMs: 30_000, anchorMs: anchor }, now); |
| 106 | +expect(next).toBe(anchor + 60_000); |
| 107 | +}); |
| 108 | + |
102 | 109 | it("never returns a past timestamp for Asia/Shanghai daily schedule (#30351)", () => { |
103 | 110 | const nowMs = Date.parse("2026-03-01T00:00:00.000Z"); |
104 | 111 | const next = computeNextRunAtMs( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。