mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Merge pull request #7128 from wwitzel3/issue-4040
Set capacity to zero before shutting down older instances
This commit is contained in:
@@ -195,7 +195,14 @@ def cluster_node_heartbeat(self):
|
|||||||
other_inst.version,
|
other_inst.version,
|
||||||
inst.hostname,
|
inst.hostname,
|
||||||
inst.version))
|
inst.version))
|
||||||
|
# Set the capacity to zero to ensure no Jobs get added to this instance.
|
||||||
|
# The heartbeat task will reset the capacity to the system capacity after upgrade.
|
||||||
|
inst.capacity = 0
|
||||||
|
inst.save()
|
||||||
stop_local_services(['uwsgi', 'celery', 'beat', 'callback', 'fact'])
|
stop_local_services(['uwsgi', 'celery', 'beat', 'callback', 'fact'])
|
||||||
|
# We wait for the Popen call inside stop_local_services above
|
||||||
|
# so the line below will rarely if ever be executed.
|
||||||
|
raise RuntimeError("Shutting down.")
|
||||||
|
|
||||||
|
|
||||||
@task(bind=True)
|
@task(bind=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user