fix: close scheduler persistence and capacity gaps
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user