mirror of
https://github.com/simple-login/app.git
synced 2024-09-29 13:11:29 +02:00
monitoring alert when more than 50 emails in queue. Check every 2 mins.
This commit is contained in:
parent
290428009a
commit
6a8c0d6f76
@ -10,7 +10,7 @@ from server import create_app
|
|||||||
# the number of consecutive fails
|
# the number of consecutive fails
|
||||||
# if more than 3 fails, alert
|
# if more than 3 fails, alert
|
||||||
# reset whenever the system comes back to normal
|
# 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
|
_nb_failed = 0
|
||||||
|
|
||||||
|
|
||||||
@ -31,8 +31,8 @@ def get_stats():
|
|||||||
|
|
||||||
global _nb_failed
|
global _nb_failed
|
||||||
# alert when too many emails in incoming + active queue
|
# alert when too many emails in incoming + active queue
|
||||||
# 20 is an arbitrary number here
|
# 50 is an arbitrary number here
|
||||||
if incoming_queue + active_queue > 20:
|
if incoming_queue + active_queue > 50:
|
||||||
_nb_failed += 1
|
_nb_failed += 1
|
||||||
|
|
||||||
if _nb_failed > 3:
|
if _nb_failed > 3:
|
||||||
@ -59,5 +59,5 @@ if __name__ == "__main__":
|
|||||||
with app.app_context():
|
with app.app_context():
|
||||||
get_stats()
|
get_stats()
|
||||||
|
|
||||||
# 5 min
|
# 2 min
|
||||||
sleep(300)
|
sleep(120)
|
||||||
|
Loading…
Reference in New Issue
Block a user