mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:20:43 +00:00
fix(cron): backfill updatedAtMs in fresh-clone path
Jobs loaded from a git-cloned jobs.json (no state file, no inline state) had updatedAtMs undefined, violating the type contract and breaking updatedAtMs sort. Backfill from createdAtMs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
Gustavo Madeira Santana
parent
0ed61b31a5
commit
074fabc540
@@ -143,6 +143,9 @@ export async function loadCronStore(storePath: string): Promise<CronStoreFile> {
|
||||
// No state file, no inline state: fresh clone or first run.
|
||||
for (const job of store.jobs) {
|
||||
job.state = (job.state && typeof job.state === "object" ? job.state : {}) as never;
|
||||
if (typeof job.updatedAtMs !== "number") {
|
||||
job.updatedAtMs = typeof job.createdAtMs === "number" ? job.createdAtMs : Date.now();
|
||||
}
|
||||
}
|
||||
}
|
||||
// else: migration mode — no state file but jobs.json has inline state. Use as-is.
|
||||
|
||||
Reference in New Issue
Block a user