mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
Secondaries should not have schedules.
This commit is contained in:
parent
d4879506c2
commit
fd6eb66b20
@ -198,9 +198,9 @@ def rebuild_graph(message):
|
||||
# NOTE: Pull status again and make sure it didn't finish in
|
||||
# the meantime?
|
||||
task.status = 'failed'
|
||||
task.job_explanation += ''.join((
|
||||
task.job_explanation += ' '.join((
|
||||
'Task was marked as running in Tower but was not present in',
|
||||
'Celery so it has been marked as failed',
|
||||
'Celery, so it has been marked as failed.',
|
||||
))
|
||||
task.save()
|
||||
task.socketio_emit_status("failed")
|
||||
|
||||
@ -39,7 +39,7 @@ from django.utils.timezone import now
|
||||
# AWX
|
||||
from awx.main.constants import CLOUD_PROVIDERS
|
||||
from awx.main.models import * # Job, JobEvent, ProjectUpdate, InventoryUpdate,
|
||||
# Schedule, UnifiedJobTemplate
|
||||
# Schedule, UnifiedJobTemplate, Instance
|
||||
from awx.main.queue import FifoQueue
|
||||
from awx.main.utils import (get_ansible_version, decrypt_field, update_scm_url,
|
||||
ignore_inventory_computed_fields, emit_websocket_notification,
|
||||
@ -87,6 +87,12 @@ def tower_periodic_scheduler(self):
|
||||
return
|
||||
logger.debug("Last run was: %s", last_run)
|
||||
write_last_run(run_now)
|
||||
|
||||
# Sanity check: If this is a secondary machine, there is nothing
|
||||
# on the schedule.
|
||||
if Instance.objects.my_role() == 'secondary':
|
||||
return
|
||||
|
||||
old_schedules = Schedule.objects.enabled().before(last_run)
|
||||
for schedule in old_schedules:
|
||||
schedule.save()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user