Adding capacity docs

Updating capacity for callback jobs to include parent process impact
This commit is contained in:
Matthew Jones
2018-02-05 09:48:48 -05:00
parent 1e9b0c2786
commit 8e94a9e599
2 changed files with 100 additions and 1 deletions

View File

@@ -620,7 +620,7 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana
# NOTE: We sorta have to assume the host count matches and that forks default to 5
from awx.main.models.inventory import Host
if self.launch_type == 'callback':
count_hosts = 1
count_hosts = 2
else:
count_hosts = Host.objects.filter(inventory__jobs__pk=self.pk).count()
return min(count_hosts, 5 if self.forks == 0 else self.forks) + 1