From 37a9ad68a2fe1cff97c9591e3dbc6fbe3871d803 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Tue, 12 May 2026 22:23:15 +0200 Subject: [PATCH] fix(live-state): cast poll_seconds to int for HTMX hx-trigger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HTMX's hx-trigger="every Ns" syntax does not accept fractional seconds — a config override like 7.5 would render every 7.5s and silently break auto-refresh. Floor to int with a 1s minimum. Co-Authored-By: Claude Sonnet 4.6 --- l4d2web/routes/server_routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l4d2web/routes/server_routes.py b/l4d2web/routes/server_routes.py index dd0865b..da2745a 100644 --- a/l4d2web/routes/server_routes.py +++ b/l4d2web/routes/server_routes.py @@ -269,5 +269,5 @@ def live_state_fragment(server_id: int) -> Response: current_players=current_rows, recent_players=recent_rows, now=datetime.now(UTC).replace(tzinfo=None), - poll_seconds=current_app.config.get("LIVE_STATE_POLL_SECONDS", 5), + poll_seconds=max(1, int(current_app.config.get("LIVE_STATE_POLL_SECONDS", 5))), )