gateway: handle websocket.disconnect in receive loop
Stops the RuntimeError spam ('Cannot call receive once a disconnect
message has been received') every time the device's watchdog reboots.
Redeployed to the tatlock-ui stack.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,8 @@ async def voice(ws: WebSocket) -> None:
|
||||
try:
|
||||
while True:
|
||||
message = await ws.receive()
|
||||
if message["type"] == "websocket.disconnect":
|
||||
raise WebSocketDisconnect(message.get("code", 1000))
|
||||
device["last_seen"] = _now()
|
||||
if "bytes" in message and message["bytes"] is not None:
|
||||
if recording:
|
||||
|
||||
Reference in New Issue
Block a user