aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
authorTom Ritter <tom@ritter.vg>2017-11-11 23:25:15 -0500
committerTom Ritter <tom@ritter.vg>2017-11-11 23:25:15 -0500
commitee3eea047c10d0032efc5a8b98d9bbdb54fe0a3a (patch)
treef7208e5c3e1107280153e6c90933f300c6113441 /jobs
parent6371a93650e74d6d4518890230eeeb5ffa7b660e (diff)
Fix executions that stomped on each other
Every hour I would fire off two executions: the minute execution and the hour execution. Each would read the statefile on start. Whichever execution took longer would overwrite the state file with the data that was present for the other's execution upon start. This would manifest as extra notifications if the starts aligned - because the 'I already sent a notification' member update wasn't being persisted. This fixes it by only performing one execution at any given time, but knowing to run all the relevant jobs for that type of execution. AKA When I run the hourly job I also run the minute jobs. Another problem related to this one is logged in #1 - minute executions that take longer than a minute will also cause this type of error.
Diffstat (limited to 'jobs')
-rwxr-xr-xjobs/JobBase.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/jobs/JobBase.py b/jobs/JobBase.py
index c5be180..3561992 100755
--- a/jobs/JobBase.py
+++ b/jobs/JobBase.py
@@ -44,9 +44,9 @@ class JobBase(object):
return self.stateName
"""Returns True if the job should execute this cron-run"""
- def shouldExecute(self, cronmode):
+ def shouldExecute(self, cronmodes):
frequency = self.executeEvery()
- if cronmode == frequency:
+ if frequency in cronmodes:
return True
return False