Fix websocket sequential awaits

This commit is contained in:
tarmst 2025-04-28 15:17:34 +00:00
parent 3ac74a4fcb
commit c9a9e05bb4

View File

@ -314,8 +314,7 @@ def get_event_emitter(request_info, update_db=True):
) )
) )
for session_id in session_ids: emit_tasks = [sio.emit(
await sio.emit(
"chat-events", "chat-events",
{ {
"chat_id": request_info.get("chat_id", None), "chat_id": request_info.get("chat_id", None),
@ -324,6 +323,9 @@ def get_event_emitter(request_info, update_db=True):
}, },
to=session_id, to=session_id,
) )
for session_id in session_ids]
await asyncio.gather(*emit_tasks)
if update_db: if update_db:
if "type" in event_data and event_data["type"] == "status": if "type" in event_data and event_data["type"] == "status":