mirror of
https://github.com/open-webui/open-webui
synced 2025-04-27 17:51:31 +00:00
leave out @ in redis+sentine url when no username/password is provided
This commit is contained in:
parent
35ea29b184
commit
257ca45456
@ -49,6 +49,8 @@ def get_sentinel_url_from_env(redis_url, sentinel_hosts_env, sentinel_port_env):
|
||||
redis_config = parse_redis_service_url(redis_url)
|
||||
username = redis_config["username"] or ""
|
||||
password = redis_config["password"] or ""
|
||||
auth_part = f"{username}:{password}"
|
||||
auth_part = ""
|
||||
if username or password:
|
||||
auth_part = f"{username}:{password}@"
|
||||
hosts_part = ",".join(f"{host}:{sentinel_port_env}" for host in sentinel_hosts_env.split(","))
|
||||
return f"redis+sentinel://{auth_part}@{hosts_part}/{redis_config['db']}/{redis_config['service']}"
|
||||
return f"redis+sentinel://{auth_part}{hosts_part}/{redis_config['db']}/{redis_config['service']}"
|
||||
|
Loading…
Reference in New Issue
Block a user