fix(live-state): cast poll_seconds to int for HTMX hx-trigger
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 <noreply@anthropic.com>
This commit is contained in:
parent
9aaa26d9a9
commit
37a9ad68a2
1 changed files with 1 additions and 1 deletions
|
|
@ -269,5 +269,5 @@ def live_state_fragment(server_id: int) -> Response:
|
||||||
current_players=current_rows,
|
current_players=current_rows,
|
||||||
recent_players=recent_rows,
|
recent_players=recent_rows,
|
||||||
now=datetime.now(UTC).replace(tzinfo=None),
|
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))),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue