From 52083e6fb7d62ccd1b98c9b9fb2952df7b21f2b1 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 19 Mar 2025 07:53:30 +0100 Subject: [PATCH] fix redis connection failure error message --- backend/config/management/commands/ta_connection.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/config/management/commands/ta_connection.py b/backend/config/management/commands/ta_connection.py index 1b8158e6..ae2f0b08 100644 --- a/backend/config/management/commands/ta_connection.py +++ b/backend/config/management/commands/ta_connection.py @@ -58,7 +58,12 @@ class Command(BaseCommand): message = " 🗙 Redis connection failed" self.stdout.write(self.style.ERROR(f"{message}")) - RedisArchivist().exec("PING") + try: + redis_conn.execute_command("PING") + except Exception as err: # pylint: disable=broad-except + message = f" 🗙 {type(err).__name__}: {err}" + self.stdout.write(self.style.ERROR(f"{message}")) + sleep(60) raise CommandError(message)