mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-21 09:01:47 -05:00
[PR #8163] [CLOSED] feat: Add the ASYNC_CHAT_SAVING_ENABLED environment variable to control the enabling of the asynchronous background database saving feature for chats.
#93209
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/8163
Author: @cr-zhichen
Created: 12/28/2024
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (3)
9d69579feat: add background saving for chat messagese25df7bfeat: Add theASYNC_CHAT_SAVING_ENABLEDenvironment variable to control the enabling of the asynchronous background database saving feature for chats.aee133fMerge branch 'open-webui:dev' into dev📊 Changes
2 files changed (+53 additions, -8 deletions)
View changed files
📝
backend/open_webui/env.py(+5 -0)📝
backend/open_webui/utils/middleware.py(+48 -8)📄 Description
In
middleware.py, theASYNC_CHAT_SAVING_ENABLEDenvironment variable has been introduced to control the enabling of the asynchronous background database saving feature for chats, addressing the output speed decrease caused by database latency as discussed in #8088.https://github.com/user-attachments/assets/949c4212-280c-4002-9d0e-666bfe6d8eb4
In the video, the change in the output speed of the same model is demonstrated after toggling the
ASYNC_CHAT_SAVING_ENABLEDfeature, withtime.sleep(0.1)used to simulate database latency.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.