mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-19 15:09:05 +08:00
fix sentinel connection being attempted for non-sentinel redis
This commit is contained in:
parent
d0b13cf388
commit
0615c11a53
@ -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)
|
return redis.Redis.from_url(redis_url, decode_responses=decode_responses)
|
||||||
|
|
||||||
def get_sentinels_from_env(sentinel_hosts_env, sentinel_port_env):
|
def get_sentinels_from_env(sentinel_hosts_env, sentinel_port_env):
|
||||||
sentinel_hosts=sentinel_hosts_env.split(',')
|
if sentinel_hosts_env:
|
||||||
sentinel_port=int(sentinel_port_env)
|
sentinel_hosts=sentinel_hosts_env.split(',')
|
||||||
return [(host, sentinel_port) for host in sentinel_hosts]
|
sentinel_port=int(sentinel_port_env)
|
||||||
|
return [(host, sentinel_port) for host in sentinel_hosts]
|
||||||
|
return []
|
||||||
|
|
||||||
class AsyncRedisSentinelManager(socketio.AsyncRedisManager):
|
class AsyncRedisSentinelManager(socketio.AsyncRedisManager):
|
||||||
def __init__(self, sentinel_hosts, sentinel_port=26379, redis_port=6379, service="mymaster", db=0,
|
def __init__(self, sentinel_hosts, sentinel_port=26379, redis_port=6379, service="mymaster", db=0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user