labels and automatizations

This commit is contained in:
Mateusz Gruszczyński
2026-05-06 23:07:19 +02:00
parent 0730e7316c
commit 98f155b53a
9 changed files with 365 additions and 350 deletions

View File

@@ -2,7 +2,7 @@ from __future__ import annotations
from datetime import datetime, timedelta, timezone
from ..config import JOBS_RETENTION_DAYS, LOG_RETENTION_DAYS, SMART_QUEUE_HISTORY_RETENTION_DAYS, TRAFFIC_HISTORY_RETENTION_DAYS
from ..config import AUTOMATION_HISTORY_RETENTION_DAYS, JOBS_RETENTION_DAYS, LOG_RETENTION_DAYS, SMART_QUEUE_HISTORY_RETENTION_DAYS, TRAFFIC_HISTORY_RETENTION_DAYS
from ..db import connect
_LAST_CLEANUP = 0.0
@@ -30,6 +30,7 @@ def cleanup(force: bool = False) -> dict[str, int]:
targets = {
"traffic_history": ("created_at", TRAFFIC_HISTORY_RETENTION_DAYS),
"smart_queue_history": ("created_at", SMART_QUEUE_HISTORY_RETENTION_DAYS),
"automation_history": ("created_at", AUTOMATION_HISTORY_RETENTION_DAYS),
"jobs": ("updated_at", JOBS_RETENTION_DAYS),
"logs": ("created_at", LOG_RETENTION_DAYS),
}