[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. #125828

Closed
opened 2026-05-21 06:30:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/8163
Author: @cr-zhichen
Created: 12/28/2024
Status: Closed

Base: devHead: dev


📝 Commits (3)

  • 9d69579 feat: add background saving for chat messages
  • e25df7b feat: Add the ASYNC_CHAT_SAVING_ENABLED environment variable to control the enabling of the asynchronous background database saving feature for chats.
  • aee133f Merge 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, the ASYNC_CHAT_SAVING_ENABLED environment 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_ENABLED feature, with time.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.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/8163 **Author:** [@cr-zhichen](https://github.com/cr-zhichen) **Created:** 12/28/2024 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (3) - [`9d69579`](https://github.com/open-webui/open-webui/commit/9d69579599b7ecc842feb317ae9a64520d78153e) feat: add background saving for chat messages - [`e25df7b`](https://github.com/open-webui/open-webui/commit/e25df7b8e0cf0321aec4bb048bc2c80e686302bd) feat: Add the `ASYNC_CHAT_SAVING_ENABLED` environment variable to control the enabling of the asynchronous background database saving feature for chats. - [`aee133f`](https://github.com/open-webui/open-webui/commit/aee133fcfde09cc3c841c7ca87d6817161725e65) Merge branch 'open-webui:dev' into dev ### 📊 Changes **2 files changed** (+53 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/env.py` (+5 -0) 📝 `backend/open_webui/utils/middleware.py` (+48 -8) </details> ### 📄 Description In `middleware.py`, the `ASYNC_CHAT_SAVING_ENABLED` environment 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_ENABLED` feature, with `time.sleep(0.1)` used to simulate database latency. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 06:30:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#125828