do not ping when server is in maintenance mode (#552)

This commit is contained in:
Karol Wypchło 2020-12-01 13:31:59 +01:00 committed by GitHub
parent f1a04d7832
commit c0673b3f76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -200,7 +200,6 @@ async def check_health():
if json_check["disabled"]:
message += "__Portal manually disabled!__ "
force_notify = True
elif res_check.status_code is not requests.codes["ok"]:
message += "__Portal down!!!__ "
force_notify = True
@ -227,7 +226,7 @@ async def check_health():
failed_records_file = json.dumps(failed_records, indent=2)
# send a message if we force notification, there is a failures dump or just once daily (heartbeat) on 1 AM
if force_notify or failed_records_file or datetime.utcnow().hour == 1:
if force_notify or json_check["disabled"] or failed_records_file or datetime.utcnow().hour == 1:
return await send_msg(
client, message, file=failed_records_file, force_notify=force_notify
)