From 6a8c0d6f7650595707156fc051183fc01acb3c54 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Tue, 8 Sep 2020 18:52:36 +0200 Subject: [PATCH] monitoring alert when more than 50 emails in queue. Check every 2 mins. --- monitoring.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monitoring.py b/monitoring.py index e38c1c8f..e30498b9 100644 --- a/monitoring.py +++ b/monitoring.py @@ -10,7 +10,7 @@ from server import create_app # the number of consecutive fails # if more than 3 fails, alert # reset whenever the system comes back to normal -# a system is considered fail if incoming_queue + active_queue > 20 +# a system is considered fail if incoming_queue + active_queue > 50 _nb_failed = 0 @@ -31,8 +31,8 @@ def get_stats(): global _nb_failed # alert when too many emails in incoming + active queue - # 20 is an arbitrary number here - if incoming_queue + active_queue > 20: + # 50 is an arbitrary number here + if incoming_queue + active_queue > 50: _nb_failed += 1 if _nb_failed > 3: @@ -59,5 +59,5 @@ if __name__ == "__main__": with app.app_context(): get_stats() - # 5 min - sleep(300) + # 2 min + sleep(120)