fix: accetta PING_INTERVAL_MINUTES in float (minuti decimali)

This commit is contained in:
Luca Sacchi Ricciardi
2026-04-26 14:46:49 +02:00
parent 95fadff399
commit 040790d61c
+2 -2
View File
@@ -69,7 +69,7 @@ def load_config() -> Settings:
try:
db_port = int(os.environ["SUPABASE_DB_PORT"])
ping_interval = int(os.environ.get("PING_INTERVAL_MINUTES", "4320"))
ping_interval = float(os.environ.get("PING_INTERVAL_MINUTES", "4320"))
web_port = int(os.environ.get("WEB_PORT", "8080"))
retention_hours = int(os.environ.get("RRD_RETENTION_HOURS", "48"))
if ping_interval <= 0 or web_port <= 0 or retention_hours <= 0:
@@ -77,7 +77,7 @@ def load_config() -> Settings:
except ValueError as exc:
raise RuntimeError(
"SUPABASE_DB_PORT, PING_INTERVAL_MINUTES, WEB_PORT e "
"RRD_RETENTION_HOURS devono essere interi positivi."
"RRD_RETENTION_HOURS devono essere numeri positivi."
) from exc
return Settings(