From 0615c11a53ca67def3a45bd2c6ca3256479bb14f Mon Sep 17 00:00:00 2001 From: Jan Kessler Date: Thu, 27 Mar 2025 10:22:49 +0100 Subject: [PATCH] fix sentinel connection being attempted for non-sentinel redis --- backend/open_webui/utils/redis.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/utils/redis.py b/backend/open_webui/utils/redis.py index 3ad1f78be..fa90a26db 100644 --- a/backend/open_webui/utils/redis.py +++ b/backend/open_webui/utils/redis.py @@ -35,9 +35,11 @@ def get_redis_connection(redis_url, redis_sentinels, decode_responses=True): return redis.Redis.from_url(redis_url, decode_responses=decode_responses) def get_sentinels_from_env(sentinel_hosts_env, sentinel_port_env): - sentinel_hosts=sentinel_hosts_env.split(',') - sentinel_port=int(sentinel_port_env) - return [(host, sentinel_port) for host in sentinel_hosts] + if sentinel_hosts_env: + sentinel_hosts=sentinel_hosts_env.split(',') + sentinel_port=int(sentinel_port_env) + return [(host, sentinel_port) for host in sentinel_hosts] + return [] class AsyncRedisSentinelManager(socketio.AsyncRedisManager): def __init__(self, sentinel_hosts, sentinel_port=26379, redis_port=6379, service="mymaster", db=0,