Flows and dashboards are created by POST under an issued or superuser-pinned id; PUT only updates; deleted flows leave a tombstone with their key; the controller stores by id and runs by key, hooks live under /hooks/<flow id>; a key with state or queued work behind it is refused until cleared
This commit is contained in:
@@ -24,6 +24,7 @@ from sqlmodel import Session, col
|
||||
|
||||
from fluksio.core.config import settings
|
||||
from fluksio.core.db import engine
|
||||
from fluksio.flow import tombstones
|
||||
from fluksio.flow.events import EventBus
|
||||
from fluksio.models import EngineEvent, FlowRun, MetricBucket
|
||||
|
||||
@@ -456,6 +457,9 @@ class MetricsCollector:
|
||||
session.execute(delete(MetricBucket).where(col(MetricBucket.bucket) < cutoff))
|
||||
session.execute(delete(EngineEvent).where(col(EngineEvent.ts) < cutoff))
|
||||
session.execute(delete(FlowRun).where(col(FlowRun.started_at) < cutoff))
|
||||
# After the rows above: a deleted flow's name is kept as long as any
|
||||
# of its history is.
|
||||
tombstones.prune(session)
|
||||
# A cascade still open long after it started did not finish; saying so
|
||||
# is more honest than leaving it running forever. A batch run is not
|
||||
# swept: it is allowed to take hours, and `Run` has its own lease sweep
|
||||
|
||||
Reference in New Issue
Block a user