mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #22945 from garethgreenaway/22571_2014_7_schedule_pillar_refresh_seconds_exceptions
Fixes to scheduler
This commit is contained in:
commit
de339bef0a
1 changed files with 15 additions and 12 deletions
|
@ -639,6 +639,21 @@ class Schedule(object):
|
|||
self.loop_interval = seconds
|
||||
run = False
|
||||
|
||||
if 'splay' in data:
|
||||
if 'when' in data:
|
||||
log.error('Unable to use "splay" with "when" option at this time. Ignoring.')
|
||||
elif 'cron' in data:
|
||||
log.error('Unable to use "splay" with "cron" option at this time. Ignoring.')
|
||||
else:
|
||||
if '_seconds' not in data:
|
||||
log.debug('The _seconds parameter is missing, '
|
||||
'most likely the first run or the schedule '
|
||||
'has been refreshed refresh.')
|
||||
if 'seconds' in data:
|
||||
data['_seconds'] = data['seconds']
|
||||
else:
|
||||
data['_seconds'] = 0
|
||||
|
||||
if job in self.intervals:
|
||||
if 'when' in data:
|
||||
if seconds == 0:
|
||||
|
@ -652,18 +667,6 @@ class Schedule(object):
|
|||
if now - self.intervals[job] >= seconds:
|
||||
run = True
|
||||
else:
|
||||
if 'splay' in data:
|
||||
if 'when' in data:
|
||||
log.error('Unable to use "splay" with "when" option at this time. Ignoring.')
|
||||
elif 'cron' in data:
|
||||
log.error('Unable to use "splay" with "cron" option at this time. Ignoring.')
|
||||
else:
|
||||
if 'seconds' in data:
|
||||
log.debug('breakage here')
|
||||
data['_seconds'] = data['seconds']
|
||||
else:
|
||||
data['_seconds'] = 0
|
||||
|
||||
if 'when' in data:
|
||||
if seconds == 0:
|
||||
if data['_when_run']:
|
||||
|
|
Loading…
Add table
Reference in a new issue