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:
parent
416c9dce0e
commit
57cd8c5613
1 changed files with 1 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue