Reduce heartbeat interval 25s→10s to beat upstream proxy idle timeout

Upstream SSL terminator closes idle WS connections at ~26s. Heartbeat
at T+25 was racing with the close. 10s interval keeps the connection
alive through any proxy with up to ~20s idle timeout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-03-18 12:56:24 +00:00
parent 416c9dce0e
commit 57cd8c5613

View file

@ -219,7 +219,7 @@ async def websocket_analyze(websocket: WebSocket):
async def _heartbeat(ws: WebSocket) -> None:
try:
while True:
await asyncio.sleep(25)
await asyncio.sleep(10)
await ws.send_json({"type": "heartbeat"})
logger.debug(f"[MAIN] Heartbeat sent to client {client_id}")
except asyncio.CancelledError: