mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 09:48:51 -03:30
Split reaper for running and waiting jobs
Avoid running jobs that have already been reapted Co-authored-by: Elijah DeLee <kdelee@redhat.com> Remove unnecessary extra actions Fix waiting jobs in other cases of reaping
This commit is contained in:
@@ -432,6 +432,10 @@ class AutoscalePool(WorkerPool):
|
||||
idx = random.choice(range(len(self.workers)))
|
||||
self.write(idx, m)
|
||||
|
||||
# if we are not in the dangerous situation of queue backup then clear old waiting jobs
|
||||
if self.workers and max(len(w.managed_tasks) for w in self.workers) <= 1:
|
||||
reaper.reap_waiting()
|
||||
|
||||
# if the database says a job is running on this node, but it's *not*,
|
||||
# then reap it
|
||||
running_uuids = []
|
||||
|
||||
Reference in New Issue
Block a user