From 383144b7a653c4f99de4e878a9ba224e1d741600 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 24 Nov 2020 13:15:50 +0100 Subject: [PATCH] tweak notifications on number of files in a node --- setup-scripts/health-checker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup-scripts/health-checker.py b/setup-scripts/health-checker.py index 79a1da5b..fe85bd06 100755 --- a/setup-scripts/health-checker.py +++ b/setup-scripts/health-checker.py @@ -335,12 +335,13 @@ async def check_portal_size(): if num_files > max_files: message += "Portal has {} files! Consider rotating! ".format(num_files) - force_notify = True + # send notification when above 40% of the limit + force_notify = num_files > max_files * 1.4 else: message += "Portal has {} files. ".format(num_files) # send a message if we force notification, or just once daily (heartbeat) on 1 AM - if force_notify or datetime.utcnow().hour == 1: + if force_notify and datetime.utcnow().hour == 1: return await send_msg( client, message, force_notify=force_notify )