soak: pass flow names as SQL parameters so observability cleanup parses
This commit is contained in:
@@ -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()",
|
||||
|
||||
Reference in New Issue
Block a user