From 3f4742a43668bb26ba6afec647f524b801da4559 Mon Sep 17 00:00:00 2001 From: Ivaylo Novakov Date: Fri, 4 Sep 2020 17:17:26 +0200 Subject: [PATCH] Only notify the team if critical checks have failed. --- setup-scripts/health-checker.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup-scripts/health-checker.py b/setup-scripts/health-checker.py index f28d8469..6322f894 100755 --- a/setup-scripts/health-checker.py +++ b/setup-scripts/health-checker.py @@ -98,9 +98,10 @@ async def check_health(): if len(failed_records) > 0: message = "Found {} failed checks ({} critical) over the last {} hours!".format(failed_checks, failed_critical, - check_hours) - await send_msg(client, message, file=discord.File(io.BytesIO(json.dumps(failed_records, indent=2).encode()), - filename="failed_checks.log"), force_notify=True) + CHECK_HOURS) + file = discord.File(io.BytesIO(json.dumps(failed_records, indent=2).encode()), filename="failed_checks.log") + notifyTeam = failed_critical > 0 + await send_msg(client, message, file=file, force_notify=notifyTeam) return # Send an informational heartbeat if all checks passed.