Adding the ability to have a job run immediately after a skip_during_range has finished.

This commit is contained in:
Gareth J. Greenaway 2017-12-12 11:23:51 -08:00
parent 66ce508a93
commit 6da25648cb
No known key found for this signature in database
GPG Key ID: 10B62F8A7CAD7A41

View File

@ -1530,6 +1530,19 @@ class Schedule(object):
log.error('Invalid date string for end in skip_during_range. Ignoring job {0}.'.format(job)) log.error('Invalid date string for end in skip_during_range. Ignoring job {0}.'.format(job))
log.error(data) log.error(data)
continue continue
# Check to see if we should run the job immediately
# after the skip_during_range is over
if 'run_after_skip_range' in data and \
data['run_after_skip_range']:
if 'run_explicit' not in data:
data['run_explicit'] = []
# Add a run_explicit for immediately after the
# skip_during_range ends
_run_immediate = end + self.opts['loop_interval']
if _run_immediate not in data['run_explicit']:
data['run_explicit'].append(_run_immediate)
if end > start: if end > start:
if start <= now <= end: if start <= now <= end:
if self.skip_function: if self.skip_function: