From 2fd7bbc2595d2c8f51ae6ffcd3290bb1862e59e0 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 20 Dec 2024 22:56:37 -0800 Subject: [PATCH] refac --- backend/open_webui/socket/main.py | 2 -- backend/open_webui/utils/middleware.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/open_webui/socket/main.py b/backend/open_webui/socket/main.py index aaf44e2cb..965fb9396 100644 --- a/backend/open_webui/socket/main.py +++ b/backend/open_webui/socket/main.py @@ -252,6 +252,4 @@ def get_event_call(request_info): def get_user_id_from_session_pool(sid): - print("get_user_id_from_session_pool", sid) - print(SESSION_POOL.get(sid)) return SESSION_POOL.get(sid) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 00434a9a9..d876539de 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -602,12 +602,12 @@ async def process_chat_response(request, response, user, events, metadata, tasks if done: data = {"done": True, "content": content, "title": title} + # Send a webhook notification if the user is not active if ( get_user_id_from_session_pool(metadata["session_id"]) is None ): webhook_url = Users.get_user_webhook_url_by_id(user.id) - print(f"webhook_url: {webhook_url}") if webhook_url: post_webhook( webhook_url,