fix: make a copy of websockets before broadcasting

This commit is contained in:
Radu C. Martin 2025-04-15 14:11:12 +02:00
parent a1fa762ea8
commit e984e70390

View file

@ -40,7 +40,9 @@ class ConnectionManager:
async def broadcast(self, ws_type: WSConnectionType, message: BaseModel):
broken = set()
for ws in self.active_connections[ws_type.value]:
conn_list = list(self.active_connections[ws_type.value])
for idx in range(len(conn_list)):
ws = conn_list[idx]
try:
await ws.send_json(message.model_dump())
except Exception: