Skip to content

Commit

Permalink
Tweak to scheduling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Littman committed Feb 7, 2017
1 parent 0dd0bcf commit 131e31e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions sfm/sfm/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions sfm/ui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 131e31e

Please sign in to comment.