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. --- jobmanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'jobmanager.py') diff --git a/jobmanager.py b/jobmanager.py index 5b3505f..5ba58b5 100755 --- a/jobmanager.py +++ b/jobmanager.py @@ -39,11 +39,11 @@ class JobManager: def list_jobs(self): return self.jobs - def execute_jobs(self, cronmode): + def execute_jobs(self, cronmodes): logging.info("Executing jobs...") emailWorks = True for thisJob in self.jobs: - if thisJob.shouldExecute(cronmode): + if thisJob.shouldExecute(cronmodes): logging.info("Executing " + thisJob.getName() + "(" + thisJob.getStateName() + ")") try: lastRunStatus = self.state[thisJob.getStateName()] -- cgit v1.2.3