improve health check reliability

This commit is contained in:
Karol Wypchlo 2021-07-12 14:49:53 +02:00
parent 7fd97b5824
commit a2aa850632
1 changed files with 3 additions and 3 deletions

View File

@ -148,15 +148,15 @@ async def check_health():
res = requests.get(endpoint + "/health-check", verify=False)
json_check = res.json()
res = requests.get(endpoint + "/health-check/critical", verify=False).json()
res = requests.get(endpoint + "/health-check/critical", verify=False)
json_critical = res.json()
res = requests.get(endpoint + "/health-check/extended", verify=False).json()
res = requests.get(endpoint + "/health-check/extended", verify=False)
json_extended = res.json()
except:
message = traceback.format_exc()
message += "\n" + "Request url: " + res.url if res.url else "-"
message += "\n" + "Status code: " + res.status_code if res.status_code else "-"
message += "\n" + "Status code: " + str(res.status_code) if res.status_code else "-"
message += "\n" + "Response body: " + res.text if res.text else "-"
return await send_msg(
client, "Failed to run health checks!", file=message, force_notify=True