mirror of
https://github.com/open-webui/open-webui
synced 2025-05-02 20:11:56 +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:
|
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":
|
||||||
|
Loading…
Reference in New Issue
Block a user