feat: Make ENABLE_WEBSOCKET_SUPPORT disable polling entirely to allow multiple replicas without sticky sessions.

See https://socket.io/docs/v4/using-multiple-nodes/ for details why this was done.

Also create a redis key to track which replica is running the cleanup job
This commit is contained in:
Jason Kidd
2024-12-06 13:03:01 -08:00
parent a38934bd23
commit 8f51681801
4 changed files with 87 additions and 32 deletions

View File

@@ -264,6 +264,7 @@ from open_webui.env import (
WEBUI_SESSION_COOKIE_SECURE,
WEBUI_AUTH_TRUSTED_EMAIL_HEADER,
WEBUI_AUTH_TRUSTED_NAME_HEADER,
ENABLE_WEBSOCKET_SUPPORT,
BYPASS_MODEL_ACCESS_CONTROL,
RESET_CONFIG_ON_START,
OFFLINE_MODE,
@@ -932,6 +933,7 @@ async def get_app_config(request: Request):
"enable_api_key": app.state.config.ENABLE_API_KEY,
"enable_signup": app.state.config.ENABLE_SIGNUP,
"enable_login_form": app.state.config.ENABLE_LOGIN_FORM,
"disable_websocket_polling": ENABLE_WEBSOCKET_SUPPORT,
**(
{
"enable_web_search": app.state.config.ENABLE_RAG_WEB_SEARCH,