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:
parent
43ae60d2f4
commit
60b399409a
@ -54,7 +54,9 @@ def tower_periodic_scheduler(self):
|
|||||||
logger.warning('No PeriodicTask found for tower_periodic_scheduler')
|
logger.warning('No PeriodicTask found for tower_periodic_scheduler')
|
||||||
return
|
return
|
||||||
logger.debug("Last run was: %s", periodic_task.last_run_at)
|
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)
|
schedules = Schedule.objects.enabled().between(periodic_task.last_run_at, run_now)
|
||||||
for schedule in schedules:
|
for schedule in schedules:
|
||||||
template = schedule.unified_job_template
|
template = schedule.unified_job_template
|
||||||
|
Loading…
Reference in New Issue
Block a user