mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-09 15:35:17 +00:00
fix(cron): retry next-second schedule compute on undefined
This commit is contained in:
@@ -138,7 +138,12 @@ export function computeJobNextRunAtMs(job: CronJob, nowMs: number): number | und
|
||||
: null;
|
||||
return atMs !== null ? atMs : undefined;
|
||||
}
|
||||
return computeStaggeredCronNextRunAtMs(job, nowMs);
|
||||
const next = computeStaggeredCronNextRunAtMs(job, nowMs);
|
||||
if (next === undefined && job.schedule.kind === "cron") {
|
||||
const nextSecondMs = Math.floor(nowMs / 1000) * 1000 + 1000;
|
||||
return computeStaggeredCronNextRunAtMs(job, nextSecondMs);
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
/** Maximum consecutive schedule errors before auto-disabling a job. */
|
||||
|
||||
Reference in New Issue
Block a user