|
@@ -91,10 +91,11 @@ class Settings(BaseSettings):
|
|
|
# Celery/Kombu 兼容的 Sentinel URL:
|
|
# Celery/Kombu 兼容的 Sentinel URL:
|
|
|
# sentinel://:password@host:port/db;sentinel://:password@host:port/db
|
|
# sentinel://:password@host:port/db;sentinel://:password@host:port/db
|
|
|
# 哨兵节点本身需要认证时,密码放在 URL 的 auth 段
|
|
# 哨兵节点本身需要认证时,密码放在 URL 的 auth 段
|
|
|
- sentinel_pwd = self.REDIS_SENTINEL_PASSWORD or self.REDIS_PASSWORD
|
|
|
|
|
|
|
+ # sentinel_pwd = self.REDIS_SENTINEL_PASSWORD or self.REDIS_PASSWORD
|
|
|
|
|
+ sentinel_pwd = self.REDIS_SENTINEL_PASSWORD
|
|
|
auth = f":{quote(sentinel_pwd, safe='')}@" if sentinel_pwd else ""
|
|
auth = f":{quote(sentinel_pwd, safe='')}@" if sentinel_pwd else ""
|
|
|
return ";".join(
|
|
return ";".join(
|
|
|
- f"sentinel://{host}:{port}/{self.REDIS_DB}"
|
|
|
|
|
|
|
+ f"sentinel://{auth}{host}:{port}/{self.REDIS_DB}"
|
|
|
for host, port in self.REDIS_SENTINEL_NODES
|
|
for host, port in self.REDIS_SENTINEL_NODES
|
|
|
)
|
|
)
|
|
|
|
|
|