From 03725ae086d5504858ff6aaef98aa1d53780459a Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:26:52 +0200 Subject: [PATCH] lifecycle: always try custom redis URL (cherry-pick #9441) (#9458) lifecycle: always try custom redis URL (#9441) Signed-off-by: Jens Langhammer Co-authored-by: Jens L --- lifecycle/wait_for_db.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lifecycle/wait_for_db.py b/lifecycle/wait_for_db.py index 82858ce968..72c1ce42dc 100755 --- a/lifecycle/wait_for_db.py +++ b/lifecycle/wait_for_db.py @@ -3,7 +3,6 @@ import authentik. This is done by the dockerfile.""" from sys import exit as sysexit from time import sleep -from urllib.parse import quote_plus from psycopg import OperationalError, connect from redis import Redis @@ -35,7 +34,7 @@ def check_postgres(): def check_redis(): - url = redis_url(CONFIG.get("redis.db")) + url = CONFIG.get("cache.url") or redis_url(CONFIG.get("redis.db")) while True: try: redis = Redis.from_url(url) @@ -43,10 +42,7 @@ def check_redis(): break except RedisError as exc: sleep(1) - sanitized_url = url.replace(quote_plus(CONFIG.get("redis.password")), "******") - CONFIG.log( - "info", f"Redis Connection failed, retrying... ({exc})", redis_url=sanitized_url - ) + CONFIG.log("info", f"Redis Connection failed, retrying... ({exc})") CONFIG.log("info", "Redis Connection successful")