Skip to content

Commit

Permalink
Get rid of process_tasks we did not need
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding committed Mar 31, 2023
1 parent df2c842 commit 4c7330c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions awx/main/scheduler/task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,18 +369,15 @@ def generate_dependencies(self, undeped_tasks):

return dependencies

def process_tasks(self):
deps = self.generate_dependencies(self.all_tasks)
undeped_deps = [dep for dep in deps if dep.dependencies_processed is False]
self.generate_dependencies(undeped_deps)
self.subsystem_metrics.inc(f"{self.prefix}_pending_processed", len(self.all_tasks) + len(undeped_deps))

@timeit
def _schedule(self):
self.get_tasks(dict(status__in=["pending"], dependencies_processed=False))

if len(self.all_tasks) > 0:
self.process_tasks()
deps = self.generate_dependencies(self.all_tasks)
undeped_deps = [dep for dep in deps if dep.dependencies_processed is False]
self.generate_dependencies(undeped_deps)
self.subsystem_metrics.inc(f"{self.prefix}_pending_processed", len(self.all_tasks) + len(undeped_deps))
ScheduleTaskManager().schedule()


Expand Down

0 comments on commit 4c7330c

Please sign in to comment.