From ee3eea047c10d0032efc5a8b98d9bbdb54fe0a3a Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Sat, 11 Nov 2017 23:25:15 -0500 Subject: 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. --- jobs/JobBase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'jobs') 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 -- cgit v1.2.3