handle 401 ES connection status code

This commit is contained in:
Simon
2025-05-13 07:13:21 +07:00
parent 56f5c6bc4b
commit 0db4ae3c19

View File

@@ -94,6 +94,10 @@ class Command(BaseCommand):
sleep(5) sleep(5)
continue continue
if status_code and status_code == 401:
sleep(5)
continue
if status_code and status_code == 200: if status_code and status_code == 200:
path = "_cluster/health?wait_for_status=yellow&timeout=60s" path = "_cluster/health?wait_for_status=yellow&timeout=60s"
_, _ = ElasticWrap(path).get(timeout=60) _, _ = ElasticWrap(path).get(timeout=60)