Only notify the team if critical checks have failed.

This commit is contained in:
Ivaylo Novakov 2020-09-04 17:17:26 +02:00
parent 5eece67b03
commit 3f4742a436
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
1 changed files with 4 additions and 3 deletions

View File

@ -98,9 +98,10 @@ async def check_health():
if len(failed_records) > 0: if len(failed_records) > 0:
message = "Found {} failed checks ({} critical) over the last {} hours!".format(failed_checks, failed_critical, message = "Found {} failed checks ({} critical) over the last {} hours!".format(failed_checks, failed_critical,
check_hours) CHECK_HOURS)
await send_msg(client, message, file=discord.File(io.BytesIO(json.dumps(failed_records, indent=2).encode()), file = discord.File(io.BytesIO(json.dumps(failed_records, indent=2).encode()), filename="failed_checks.log")
filename="failed_checks.log"), force_notify=True) notifyTeam = failed_critical > 0
await send_msg(client, message, file=file, force_notify=notifyTeam)
return return
# Send an informational heartbeat if all checks passed. # Send an informational heartbeat if all checks passed.