mirror of https://github.com/openclaw/openclaw.git
fix(cron): retry next-second schedule compute on undefined
This commit is contained in:
parent
c26cf6aa83
commit
dd4eb8bf63
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Reference in New Issue