fix: accetta PING_INTERVAL_MINUTES in float (minuti decimali)
This commit is contained in:
@@ -69,7 +69,7 @@ def load_config() -> Settings:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
db_port = int(os.environ["SUPABASE_DB_PORT"])
|
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"))
|
web_port = int(os.environ.get("WEB_PORT", "8080"))
|
||||||
retention_hours = int(os.environ.get("RRD_RETENTION_HOURS", "48"))
|
retention_hours = int(os.environ.get("RRD_RETENTION_HOURS", "48"))
|
||||||
if ping_interval <= 0 or web_port <= 0 or retention_hours <= 0:
|
if ping_interval <= 0 or web_port <= 0 or retention_hours <= 0:
|
||||||
@@ -77,7 +77,7 @@ def load_config() -> Settings:
|
|||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"SUPABASE_DB_PORT, PING_INTERVAL_MINUTES, WEB_PORT e "
|
"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
|
) from exc
|
||||||
|
|
||||||
return Settings(
|
return Settings(
|
||||||
|
|||||||
Reference in New Issue
Block a user