fix(doctor): avoid false-positive legacy cron store warning when stor… · openclaw/openclaw@274b7b1
liuhao1024
·
2026-06-14
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -578,6 +578,27 @@ describe("maybeRepairLegacyCronStore", () => {
|
578 | 578 | expectNoteContaining("Cron run logs migrated to SQLite", "Doctor changes"); |
579 | 579 | }); |
580 | 580 | |
| 581 | +it("does not claim legacy store detected when only non-legacy issues exist (#92683)", async () => { |
| 582 | +const storePath = await makeTempStorePath(); |
| 583 | +await writeCurrentCronStore(storePath, [ |
| 584 | +createCurrentCronJob({ |
| 585 | +id: "notify-job", |
| 586 | +name: "Notify job", |
| 587 | +notify: true, |
| 588 | +}), |
| 589 | +]); |
| 590 | + |
| 591 | +await maybeRepairLegacyCronStore({ |
| 592 | +cfg: createCronConfig(storePath), |
| 593 | +options: {}, |
| 594 | +prompter: makePrompter(true), |
| 595 | +}); |
| 596 | + |
| 597 | +expectNoNoteContaining("Legacy cron job storage detected", "Cron"); |
| 598 | +expectNoteContaining("Cron store issues detected", "Cron"); |
| 599 | +expectNoteContaining("1 job still uses legacy", "Cron"); |
| 600 | +}); |
| 601 | + |
581 | 602 | it("repairs malformed persisted cron ids before list rendering sees them", async () => { |
582 | 603 | const storePath = await makeTempStorePath(); |
583 | 604 | await writeCronStore(storePath, [ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -368,9 +368,13 @@ export async function maybeRepairLegacyCronStore(params: {
|
368 | 368 | return; |
369 | 369 | } |
370 | 370 | |
| 371 | +const noteHeading = legacyStoreDetected |
| 372 | + ? `Legacy cron job storage detected at ${shortenHomePath(storePath)}.` |
| 373 | + : `Cron store issues detected at ${shortenHomePath(storePath)}.`; |
| 374 | + |
371 | 375 | note( |
372 | 376 | [ |
373 | | -`Legacy cron job storage detected at ${shortenHomePath(storePath)}.`, |
| 377 | +noteHeading, |
374 | 378 | ...previewLines, |
375 | 379 | `Repair with ${formatCliCommand("openclaw doctor --fix")} to normalize the store before the next scheduler run.`, |
376 | 380 | ].join("\n"), |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。