fix: opt draft storage into real callers
This commit is contained in:
+12
-3
@@ -22,12 +22,21 @@ class WorkflowStores:
|
||||
run_store: RunStore
|
||||
|
||||
|
||||
def file_workflow_stores(root: str | Path) -> WorkflowStores:
|
||||
"""Create process-local file-backed workflow stores under one root."""
|
||||
def file_workflow_stores(
|
||||
root: str | Path,
|
||||
*,
|
||||
drafts: bool = False,
|
||||
) -> WorkflowStores:
|
||||
"""Create file-backed workflow stores, opting into draft persistence.
|
||||
|
||||
Artifact and run stores are needed by every durable workflow server. Draft
|
||||
workspaces are a separate product surface, so avoid constructing their
|
||||
store (which creates its directory) unless a caller explicitly enables it.
|
||||
"""
|
||||
store_root = Path(root)
|
||||
return WorkflowStores(
|
||||
artifact_store=FileWorkflowArtifactStore(store_root),
|
||||
draft_workspace_store=FileDraftWorkspaceStore(store_root),
|
||||
draft_workspace_store=(FileDraftWorkspaceStore(store_root) if drafts else None),
|
||||
run_store=FileRunStore(store_root),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user