diff --git a/src/cron/service/jobs.ts b/src/cron/service/jobs.ts index 302ccefa25..e547ed9de4 100644 --- a/src/cron/service/jobs.ts +++ b/src/cron/service/jobs.ts @@ -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. */