mirror of
https://github.com/ansible/awx.git
synced 2026-04-17 16:00:18 -02:30
defer loading Job.artifacts on host views to improve performance
see: https://github.com/ansible/awx/issues/8006 this data can be *really* large, and we don't actually need it for the summary fields on this API endpoint
This commit is contained in:
@@ -1702,7 +1702,10 @@ class HostSerializer(BaseSerializerWithVariables):
|
||||
'type': j.job.job_type_name,
|
||||
'status': j.job.status,
|
||||
'finished': j.job.finished,
|
||||
} for j in obj.job_host_summaries.select_related('job__job_template').order_by('-created')[:5]])
|
||||
} for j in obj.job_host_summaries.select_related('job__job_template').order_by('-created').defer(
|
||||
'job__extra_vars',
|
||||
'job__artifacts',
|
||||
)[:5]])
|
||||
return d
|
||||
|
||||
def _get_host_port_from_name(self, name):
|
||||
|
||||
Reference in New Issue
Block a user