From 57cd8c56133811734d38be4eb0c05584945deac8 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Wed, 18 Mar 2026 12:56:24 +0000 Subject: [PATCH] =?UTF-8?q?Reduce=20heartbeat=20interval=2025s=E2=86=9210s?= =?UTF-8?q?=20to=20beat=20upstream=20proxy=20idle=20timeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- backend/app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/main.py b/backend/app/main.py index 12103e0..265b4d0 100755 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -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: