mirror of
https://github.com/open-webui/open-webui
synced 2025-05-01 11:26:00 +00:00
Fix websocket sequential awaits
This commit is contained in:
parent
3ac74a4fcb
commit
c9a9e05bb4
@ -314,8 +314,7 @@ def get_event_emitter(request_info, update_db=True):
|
||||
)
|
||||
)
|
||||
|
||||
for session_id in session_ids:
|
||||
await sio.emit(
|
||||
emit_tasks = [sio.emit(
|
||||
"chat-events",
|
||||
{
|
||||
"chat_id": request_info.get("chat_id", None),
|
||||
@ -324,6 +323,9 @@ def get_event_emitter(request_info, update_db=True):
|
||||
},
|
||||
to=session_id,
|
||||
)
|
||||
for session_id in session_ids]
|
||||
|
||||
await asyncio.gather(*emit_tasks)
|
||||
|
||||
if update_db:
|
||||
if "type" in event_data and event_data["type"] == "status":
|
||||
|
Loading…
Reference in New Issue
Block a user