mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 18:46:39 +00:00
fix: schedule nextWakeAtMs for isolated sessionTarget cron jobs (#19541)
* fix(cron): repair isolated next wake scheduling * cron: harden isolated next-wake timestamp guards --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -250,8 +250,12 @@ export function armTimer(state: CronServiceState) {
|
||||
const jobCount = state.store?.jobs.length ?? 0;
|
||||
const enabledCount = state.store?.jobs.filter((j) => j.enabled).length ?? 0;
|
||||
const withNextRun =
|
||||
state.store?.jobs.filter((j) => j.enabled && typeof j.state.nextRunAtMs === "number")
|
||||
.length ?? 0;
|
||||
state.store?.jobs.filter(
|
||||
(j) =>
|
||||
j.enabled &&
|
||||
typeof j.state.nextRunAtMs === "number" &&
|
||||
Number.isFinite(j.state.nextRunAtMs),
|
||||
).length ?? 0;
|
||||
state.deps.log.debug(
|
||||
{ jobCount, enabledCount, withNextRun },
|
||||
"cron: armTimer skipped - no jobs with nextRunAtMs",
|
||||
@@ -476,7 +480,7 @@ function isRunnableJob(params: {
|
||||
return false;
|
||||
}
|
||||
const next = job.state.nextRunAtMs;
|
||||
return typeof next === "number" && nowMs >= next;
|
||||
return typeof next === "number" && Number.isFinite(next) && nowMs >= next;
|
||||
}
|
||||
|
||||
function collectRunnableJobs(
|
||||
|
||||
Reference in New Issue
Block a user