From 0db4ae3c194dcf0fb3d60aa710b4fa3eeb19a207 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 13 May 2025 07:13:21 +0700 Subject: [PATCH] handle 401 ES connection status code --- backend/config/management/commands/ta_connection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/config/management/commands/ta_connection.py b/backend/config/management/commands/ta_connection.py index ae2f0b08..3edb42db 100644 --- a/backend/config/management/commands/ta_connection.py +++ b/backend/config/management/commands/ta_connection.py @@ -94,6 +94,10 @@ class Command(BaseCommand): sleep(5) continue + if status_code and status_code == 401: + sleep(5) + continue + if status_code and status_code == 200: path = "_cluster/health?wait_for_status=yellow&timeout=60s" _, _ = ElasticWrap(path).get(timeout=60)