From 36aa7c831199fa46b889233f5510e46887a19da9 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Mon, 12 Jul 2021 14:53:12 +0200 Subject: [PATCH] improve health check reliability --- setup-scripts/health-checker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup-scripts/health-checker.py b/setup-scripts/health-checker.py index c4af5f39..c751d1de 100755 --- a/setup-scripts/health-checker.py +++ b/setup-scripts/health-checker.py @@ -148,6 +148,8 @@ async def check_health(): res = requests.get(endpoint + "/health-check", verify=False) json_check = res.json() + server_down = res.status_code is not requests.codes["ok"] + res = requests.get(endpoint + "/health-check/critical", verify=False) json_critical = res.json() @@ -208,7 +210,7 @@ async def check_health(): if json_check["disabled"]: message += "__Portal manually disabled!__ " - elif res_check.status_code is not requests.codes["ok"]: + elif server_down: message += "__Portal down!!!__ " force_notify = True