1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Merge pull request #5710 from ryanpetrello/job-event-api-perf

drastically speed up /api/v2/jobs/N/job_events/ with large counts

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-01-21 15:54:02 +00:00 committed by GitHub
commit 1ce197041f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3858,8 +3858,7 @@ class JobJobEventsList(BaseJobEventsList):
def get_queryset(self):
job = self.get_parent_object()
self.check_parent_access(job)
qs = job.job_events
qs = qs.select_related('host')
qs = job.job_events.select_related('host').order_by('start_line')
return qs.all()