soak: pass flow names as SQL parameters so observability cleanup parses

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-14 23:51:24 +02:00
co-authored by Claude Opus 5.5
parent 9a5d7a0d0c
commit 810290e523
+2 -2
View File
@@ -849,13 +849,13 @@ def clear_redis() -> None:
def clear_observability() -> None:
"""The collector wrote rollups, runs and events for the soak flows."""
names = ", ".join(repr(flow) for flow in FLOWS)
marks = ", ".join("?" for _ in FLOWS)
script = "\n".join(
[
"import sqlite3",
"db = sqlite3.connect('/data/fluksio.db')",
*(
f"db.execute('DELETE FROM {table} WHERE flow IN ({names})')"
f"db.execute('DELETE FROM {table} WHERE flow IN ({marks})', {FLOWS!r})"
for table in ("metric_minute", "flow_run", "engine_event")
),
"db.commit()",