server: fix websocket

This commit is contained in:
Mathieu Virbel
2023-08-09 14:37:39 +02:00
parent 26e34aec2d
commit 92366f2662

View File

@@ -211,8 +211,11 @@ class WebsocketManager:
async def send_json(self, transcript_id: UUID, message): async def send_json(self, transcript_id: UUID, message):
if transcript_id not in self.active_connections: if transcript_id not in self.active_connections:
return return
for connection in self.active_connections[transcript_id]: for connection in self.active_connections[transcript_id][:]:
await connection.send_json(message) try:
await connection.send_json(message)
except Exception:
self.active_connections[transcript_id].remove(connection)
ws_manager = WebsocketManager() ws_manager = WebsocketManager()