refac: clean up Redis sentinel utilities and import grouping

This commit is contained in:
Timothy Jaeryang Baek committed 2026-05-21 11:47:25 +04:00
1 parent 1527eb6e01
commit 154679200f
5 files changed
+321 -289

No files matched your search

+7
View File
@@ -193,6 +193,13 @@ class AppConfig:
super().__setattr__('_entries', {})
super().__setattr__('_key_prefix', redis_key_prefix)
# If sentinels weren't explicitly provided, read from env.
if redis_sentinels is None:
from open_webui.env import REDIS_SENTINEL_HOSTS, REDIS_SENTINEL_PORT
from open_webui.utils.redis import get_sentinels_from_env
redis_sentinels = get_sentinels_from_env(REDIS_SENTINEL_HOSTS, REDIS_SENTINEL_PORT)
rc: Union[redis.Redis, redis.cluster.RedisCluster, None] = None
if redis_url:
rc = get_redis_connection(redis_url, redis_sentinels or [], redis_cluster, decode_responses=True)