fix: close scheduler persistence and capacity gaps

This commit is contained in:
lda
2026-09-09 19:13:17 +07:00 Verified
parent 39993c9d5e
commit 787a3c433f
7 changed files with 296 additions and 13 deletions
+17
View File
@@ -110,6 +110,23 @@ class WorkflowScheduleApi:
raise KeyError("workflow schedule store is not configured")
return store
def bind_schedule_store(self, store: Any) -> None:
"""Bind the composition-owned schedule store exactly once.
Server composition uses this seam when the scheduler is enabled on a
server that was built without the optional schedule surface. Refuse
to replace an already configured store: API and scheduler writes must
remain on one same-process lock and one durable root.
"""
if self._explicit_schedule_store is not None:
if self._explicit_schedule_store is not store:
raise ValueError("workflow schedule store is already configured")
return
context_store = getattr(self.context, "schedule_store", None)
if context_store is not None and context_store is not store:
raise ValueError("workflow schedule store is already configured")
self._explicit_schedule_store = store
def _artifact_store(self) -> Any:
if self.context.artifact_store is None:
raise KeyError("workflow artifact store is not configured")