fix(cron): preserve pending actions until store save succeeds

This commit is contained in:
yu-xin-c authored and Xubin Ren committed 2026-10-03 00:08:49 +08:00
1 parent f2737ae813
commit 0dcc03c4a9
2 files changed
+87 -1

No files matched your search

+2 -1
View File
@@ -309,8 +309,9 @@ class CronService:
continue
self._store.jobs = list(jobs_map.values()) # pyright: ignore[reportOptionalMemberAccess]
if self._should_persist_store() and changed:
self._action_path.write_text("", encoding="utf-8")
# Keep accepted actions recoverable until the merged snapshot is durable.
self._save_store()
self._action_path.write_text("", encoding="utf-8")
return
def _load_store(self, *, reload_during_execution: bool = False) -> CronStore | None: