From ef994e00849486987fa6f2bf36d108767b34ddec Mon Sep 17 00:00:00 2001 From: Jens L Date: Thu, 25 Nov 2021 13:44:42 +0100 Subject: [PATCH] lifecycle: improve redis connection debug py printing full URL --- lifecycle/wait_for_db.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lifecycle/wait_for_db.py b/lifecycle/wait_for_db.py index b2b908fd2..af157ac46 100755 --- a/lifecycle/wait_for_db.py +++ b/lifecycle/wait_for_db.py @@ -43,15 +43,16 @@ while True: REDIS_PROTOCOL_PREFIX = "redis://" if CONFIG.y_bool("redis.tls", False): REDIS_PROTOCOL_PREFIX = "rediss://" +REDIS_URL = ( + f"{REDIS_PROTOCOL_PREFIX}:" + f"{CONFIG.y('redis.password')}@{CONFIG.y('redis.host')}:" + f"{int(CONFIG.y('redis.port'))}/{CONFIG.y('redis.ws_db')}" +) while True: try: - redis = Redis.from_url( - f"{REDIS_PROTOCOL_PREFIX}:" - f"{CONFIG.y('redis.password')}@{CONFIG.y('redis.host')}:" - f"{int(CONFIG.y('redis.port'))}/{CONFIG.y('redis.ws_db')}" - ) + redis = Redis.from_url(REDIS_URL) redis.ping() break except RedisError as exc: sleep(1) - j_print(f"Redis Connection failed, retrying... ({exc})") + j_print(f"Redis Connection failed, retrying... ({exc})", redis_url=REDIS_URL)