Only announce healthy status once a day.

This commit is contained in:
Ivaylo Novakov 2020-09-08 18:20:56 +02:00
parent ddf72ad850
commit 8235d75795
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
1 changed files with 4 additions and 2 deletions

View File

@ -159,8 +159,10 @@ async def check_health():
await send_msg(client, message, file=file, force_notify=notifyTeam)
return
# Send an informational heartbeat if all checks passed.
await send_msg(client, "Health checks passed: {}/{}\n".format(passed_checks, checks))
# Send an informational heartbeat if all checks passed but only if it's in
# the first CHECK_HOURS hours of the day, essentially the first call.
if datetime.now().hour < CHECK_HOURS:
await send_msg(client, "Health checks passed: {}/{}\n".format(passed_checks, checks))
client.run(bot_token)