From 131e31e0d08aaa4c790a9d90abb0f67a7ba25cd7 Mon Sep 17 00:00:00 2001 From: Justin Littman Date: Tue, 7 Feb 2017 09:54:08 -0500 Subject: [PATCH] Tweak to scheduling. --- sfm/sfm/settings/common.py | 5 ++--- sfm/ui/config.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sfm/sfm/settings/common.py b/sfm/sfm/settings/common.py index 79d3e4da..b0772684 100644 --- a/sfm/sfm/settings/common.py +++ b/sfm/sfm/settings/common.py @@ -211,8 +211,7 @@ # Whether to scan the amount of free space on /sfm-data and /sfm-processing PERFORM_SCAN_FREE_SPACE = env.get('SFM_PERFORM_SCAN_FREE_SPACE', 'True') == 'True' -SCAN_FREE_SPACE_HOUR = env.get('SFM_SCAN_FREE_SPACE_HOUR', '2') -SCAN_FREE_SPACE_MINUTE = env.get('SFM_SCAN_FREE_SPACE_MINUTE', '0') +SCAN_FREE_SPACE_HOUR_INTERVAL = env.get('SFM_SCAN_FREE_SPACE_HOUR_INTERVAL', '12') # sfm data space threshold to send notification email,only ends with MB,GB,TB. eg. 500MB,10GB,1TB DATA_THRESHOLD = env.get('DATA_VOLUME_THRESHOLD', '10GB') # sfm processing space threshold to send notification email,only ends with MB,GB,TB. eg. 500MB,10GB,1TB @@ -221,7 +220,7 @@ # Whether to scan the amount of free space on /sfm-data and /sfm-processing PERFORM_MONITOR_QUEUE = env.get('SFM_PERFORM_MONITOR_QUEUE', 'True') == 'True' # frequency to check the queue message length,default is 2 hour -MONITOR_QUEUE_HOUR = env.get('SFM_MONITOR_QUEUE_HOUR', '2') +MONITOR_QUEUE_HOUR_INTERVAL = env.get('SFM_MONITOR_QUEUE_HOUR_INTERVAL', '12') # queue threshold for each harvester to send warning message QUEUE_LENGTH_THRESHOLD = { 'Web Harvester': env.get('WEB_QUEUE_LENGTH_THRESHOLD', '25') diff --git a/sfm/ui/config.py b/sfm/ui/config.py index cf284efb..c45be4be 100644 --- a/sfm/ui/config.py +++ b/sfm/ui/config.py @@ -57,14 +57,14 @@ def ready(self): if settings.PERFORM_SCAN_FREE_SPACE: if sched.get_job('scan_free_space') is not None: sched.remove_job('scan_free_space') - sched.add_job(send_free_space_emails, 'cron', hour=settings.SCAN_FREE_SPACE_HOUR, - minute=settings.SCAN_FREE_SPACE_MINUTE, id='scan_free_space') + sched.add_job(send_free_space_emails, 'interval', hours=int(settings.SCAN_FREE_SPACE_HOUR_INTERVAL), + id='scan_free_space') # scheduled job to check monitor queue message if settings.PERFORM_MONITOR_QUEUE: if sched.get_job('monitor_queue_length') is not None: sched.remove_job('monitor_queue_length') - sched.add_job(send_queue_warn_emails, 'interval', hours=int(settings.MONITOR_QUEUE_HOUR), + sched.add_job(send_queue_warn_emails, 'interval', hours=int(settings.MONITOR_QUEUE_HOUR_INTERVAL), id='monitor_queue_length') # Serialization