diff --git a/cli/tests/unit/kv_test.ts b/cli/tests/unit/kv_test.ts index ea1e328bc2..d3038a44b1 100644 --- a/cli/tests/unit/kv_test.ts +++ b/cli/tests/unit/kv_test.ts @@ -1550,9 +1550,9 @@ dbTest("queue nan delay", async (db) => { }); dbTest("queue large delay", async (db) => { - await db.enqueue("test", { delay: 7 * 24 * 60 * 60 * 1000 }); + await db.enqueue("test", { delay: 30 * 24 * 60 * 60 * 1000 }); await assertRejects(async () => { - await db.enqueue("test", { delay: 7 * 24 * 60 * 60 * 1000 + 1 }); + await db.enqueue("test", { delay: 30 * 24 * 60 * 60 * 1000 + 1 }); }, TypeError); }); diff --git a/ext/kv/01_db.ts b/ext/kv/01_db.ts index a1015d55df..e934a3b6dc 100644 --- a/ext/kv/01_db.ts +++ b/ext/kv/01_db.ts @@ -26,14 +26,14 @@ async function openKv(path: string) { return new Kv(rid, kvSymbol); } -const millisecondsInOneWeek = 7 * 24 * 60 * 60 * 1000; +const maxQueueDelay = 30 * 24 * 60 * 60 * 1000; function validateQueueDelay(delay: number) { if (delay < 0) { throw new TypeError("delay cannot be negative"); } - if (delay > millisecondsInOneWeek) { - throw new TypeError("delay cannot be greater than one week"); + if (delay > maxQueueDelay) { + throw new TypeError("delay cannot be greater than 30 days"); } if (isNaN(delay)) { throw new TypeError("delay cannot be NaN");