Skip to content

Commit 40e23b0

Browse files
authored
fix(cron): re-arm timer in finally to survive transient errors (#9948)
1 parent 313e2f2 commit 40e23b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cron/service/timer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ export async function onTimer(state: CronServiceState) {
4848
await runDueJobs(state);
4949
recomputeNextRuns(state);
5050
await persist(state);
51-
armTimer(state);
5251
});
5352
} finally {
5453
state.running = false;
54+
// Always re-arm so transient errors (e.g. ENOSPC) don't kill the scheduler.
55+
armTimer(state);
5556
}
5657
}
5758

0 commit comments

Comments
 (0)