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

This commit is contained in:
2026-10-14 23:51:24 +02:00
parent 1dfdfe0ae4
commit 2fba7b66d7
+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()",