mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 15:08:03 -03:30
Query database running tasks after querying celery to prevent race
condition that could cause us to think the task was orphaned
This commit is contained in:
parent
aac6cc6a5a
commit
6dae240849
@ -142,9 +142,6 @@ def get_tasks():
|
||||
def rebuild_graph(message):
|
||||
''' Regenerate the task graph by refreshing known tasks from Tower, purging orphaned running tasks,
|
||||
and creatingdependencies for new tasks before generating directed edge relationships between those tasks '''
|
||||
all_sorted_tasks = get_tasks()
|
||||
if not len(all_sorted_tasks):
|
||||
return None
|
||||
|
||||
inspector = inspect()
|
||||
if not hasattr(settings, 'IGNORE_CELERY_INSPECTOR'):
|
||||
@ -153,6 +150,10 @@ def rebuild_graph(message):
|
||||
print("Ignoring celery task inspector")
|
||||
active_task_queues = None
|
||||
|
||||
all_sorted_tasks = get_tasks()
|
||||
if not len(all_sorted_tasks):
|
||||
return None
|
||||
|
||||
active_tasks = []
|
||||
if active_task_queues is not None:
|
||||
for queue in active_task_queues:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user