sweep_artifacts: narrow the optional flow store for mypy

This commit is contained in:
2026-10-15 09:55:41 +02:00
parent 5e5f1836cb
commit e6afc23952
+9 -8
View File
@@ -403,14 +403,15 @@ def sweep_artifacts(
return 0
keep = set(session.exec(select(col(RunArtifact.digest)).distinct()).all())
for name in flows.list_flows() if flows else ():
for draft in (False, True):
try:
flow = flows.read_flow(name, draft=draft)
except FlowNotFound:
continue
for declared in flow.inputs:
_references_in(declared.initial, keep)
if flows is not None:
for name in flows.list_flows():
for draft in (False, True):
try:
flow = flows.read_flow(name, draft=draft)
except FlowNotFound:
continue
for declared in flow.inputs:
_references_in(declared.initial, keep)
keys = state.keys()
for start in range(0, len(keys), _SWEEP_BATCH):