From 8235d757950bb049279f84d2b3faf9399fccbb5c Mon Sep 17 00:00:00 2001 From: Ivaylo Novakov Date: Tue, 8 Sep 2020 18:20:56 +0200 Subject: [PATCH] Only announce healthy status once a day. --- setup-scripts/health-checker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup-scripts/health-checker.py b/setup-scripts/health-checker.py index a3ea7f23..bdf2b9ef 100755 --- a/setup-scripts/health-checker.py +++ b/setup-scripts/health-checker.py @@ -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)