From c0673b3f76c9d8e2c8a6bf2861d594b56523afab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Wypch=C5=82o?= Date: Tue, 1 Dec 2020 13:31:59 +0100 Subject: [PATCH] do not ping when server is in maintenance mode (#552) --- setup-scripts/health-checker.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup-scripts/health-checker.py b/setup-scripts/health-checker.py index 2e3960ad..380e3d77 100755 --- a/setup-scripts/health-checker.py +++ b/setup-scripts/health-checker.py @@ -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 )