Skip to content

Commit ff86283

Browse files
tjbckAlgorithm5838
andcommitted
refac
Co-Authored-By: Algorithm5838 <108630393+Algorithm5838@users.noreply.github.com>
1 parent e901111 commit ff86283

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

backend/open_webui/socket/main.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ async def __event_emitter__(event_data):
790790
},
791791
room=f"user:{user_id}",
792792
)
793+
793794
if (
794795
update_db
795796
and message_id
@@ -799,16 +800,12 @@ async def __event_emitter__(event_data):
799800
event_type = event_data.get("type")
800801

801802
if event_type == "status":
802-
# Only persist final (done) status to DB; intermediate
803-
# statuses are ephemeral UI-only data sent via socket.
804-
status_data = event_data.get("data", {})
805-
if status_data.get("done", False):
806-
await asyncio.to_thread(
807-
Chats.add_message_status_to_chat_by_id_and_message_id,
808-
request_info["chat_id"],
809-
request_info["message_id"],
810-
status_data,
811-
)
803+
await asyncio.to_thread(
804+
Chats.add_message_status_to_chat_by_id_and_message_id,
805+
request_info["chat_id"],
806+
request_info["message_id"],
807+
status_data,
808+
)
812809

813810
elif event_type == "message":
814811
message = await asyncio.to_thread(

0 commit comments

Comments
 (0)