From c1a02ec7d8f528ce352b441df08f6efa379f1df6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 26 Mar 2025 01:11:12 -0700 Subject: [PATCH] refac --- backend/open_webui/socket/main.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/backend/open_webui/socket/main.py b/backend/open_webui/socket/main.py index 9fea25ea0..bc4bc887d 100644 --- a/backend/open_webui/socket/main.py +++ b/backend/open_webui/socket/main.py @@ -287,7 +287,6 @@ def get_event_emitter(request_info, update_db=True): to=session_id, ) - if update_db: if "type" in event_data and event_data["type"] == "status": Chats.add_message_status_to_chat_by_id_and_message_id( @@ -314,15 +313,15 @@ def get_event_emitter(request_info, update_db=True): ) if "type" in event_data and event_data["type"] == "replace": - content = event_data.get("data", {}).get("content", "") + content = event_data.get("data", {}).get("content", "") - Chats.upsert_message_to_chat_by_id_and_message_id( - request_info["chat_id"], - request_info["message_id"], - { - "content": content, - }, - ) + Chats.upsert_message_to_chat_by_id_and_message_id( + request_info["chat_id"], + request_info["message_id"], + { + "content": content, + }, + ) return __event_emitter__