mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Fix a bug processing dependent tasks. Fix an issue where we weren't
calculating the task impact of a job properly
This commit is contained in:
parent
f5ea85e0fc
commit
116cf902b5
@ -177,7 +177,7 @@ def rebuild_graph(message):
|
||||
time_delt = len(task_dependencies) - task_dependencies.index(dep)
|
||||
dep.created = task.created - datetime.timedelta(seconds=1+time_delt)
|
||||
dep.save()
|
||||
waiting_tasks.insert(dep, waiting_tasks.index(task))
|
||||
waiting_tasks.insert(waiting_tasks.index(task), dep)
|
||||
task.status = 'waiting'
|
||||
task.save()
|
||||
|
||||
|
||||
@ -15,6 +15,9 @@ import uuid
|
||||
# PyYAML
|
||||
import yaml
|
||||
|
||||
# ZMQ
|
||||
import zmq
|
||||
|
||||
# Django
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
@ -328,7 +331,9 @@ class Job(CommonTask):
|
||||
@property
|
||||
def task_impact(self):
|
||||
# NOTE: We sorta have to assume the host count matches and that forks default to 5
|
||||
return min(self._get_hosts().count(), 5 if self.forks == 0 else self.forks) * 10
|
||||
from awx.main.models.inventory import Host
|
||||
count_hosts = Host.objects.filter(inventory__jobs__pk=self.pk).count()
|
||||
return min(count_hosts, 5 if self.forks == 0 else self.forks) * 10
|
||||
|
||||
@property
|
||||
def successful_hosts(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user