Merge pull request #11148 from Ithanil/redis_sentinel

feat: Support for Redis Sentinel
This commit is contained in:
Timothy Jaeryang Baek
2025-03-27 20:36:53 -07:00
committed by GitHub
6 changed files with 128 additions and 14 deletions

View File

@@ -317,6 +317,8 @@ from open_webui.env import (
AUDIT_LOG_LEVEL,
CHANGELOG,
REDIS_URL,
REDIS_SENTINEL_HOSTS,
REDIS_SENTINEL_PORT,
GLOBAL_LOG_LEVEL,
MAX_BODY_LOG_SIZE,
SAFE_MODE,
@@ -360,6 +362,9 @@ from open_webui.utils.security_headers import SecurityHeadersMiddleware
from open_webui.tasks import stop_task, list_tasks # Import from tasks.py
from open_webui.utils.redis import get_sentinels_from_env
if SAFE_MODE:
print("SAFE MODE ENABLED")
Functions.deactivate_all_functions()
@@ -423,7 +428,7 @@ app = FastAPI(
oauth_manager = OAuthManager(app)
app.state.config = AppConfig(redis_url=REDIS_URL)
app.state.config = AppConfig(redis_url=REDIS_URL, redis_sentinels=get_sentinels_from_env(REDIS_SENTINEL_HOSTS, REDIS_SENTINEL_PORT))
app.state.WEBUI_NAME = WEBUI_NAME
app.state.LICENSE_METADATA = None