1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Update old schedules if we missed them

This commit is contained in:
Matthew Jones 2014-03-31 15:33:25 -04:00
parent 43ae60d2f4
commit 60b399409a

View File

@ -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