From 60b399409ab3e3b6a44d69daa66ddc72cd3bb1ff Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 31 Mar 2014 15:33:25 -0400 Subject: [PATCH] Update old schedules if we missed them --- awx/main/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index fa19c4d02c..9a3c7c1440 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -54,7 +54,9 @@ def tower_periodic_scheduler(self): logger.warning('No PeriodicTask found for tower_periodic_scheduler') return logger.debug("Last run was: %s", periodic_task.last_run_at) - # TODO: Cleanup jobs that we missed + old_schedules = Schedule.objects.enabled().before(periodic_task.last_run_at) + for schedule in old_schedules: + schedule.save() schedules = Schedule.objects.enabled().between(periodic_task.last_run_at, run_now) for schedule in schedules: template = schedule.unified_job_template