diff options
author | Rémy Coutable <remy@rymai.me> | 2018-06-05 13:11:23 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-06-05 13:11:23 +0300 |
commit | 7adfc4249cdfd46bd4bf39a080db238e99b5aba3 (patch) | |
tree | 5258281661e7be23c05ca27895a0526e98492574 /lib | |
parent | 6b85ea558383b89412f79dc17be8b274ad42205f (diff) | |
parent | 2bb94ff7f915bdc09275085a075e202f92241811 (diff) |
Merge branch 'sh-fix-pipeline-jobs-nplus-one' into 'master'
Eliminate N+1 queries for CI job artifacts in /api/projects/:id/pipelines/:pipeline_id/jobs
See merge request gitlab-org/gitlab-ce!19353
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/jobs.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb index 54d1acbd412..e95b0dd5267 100644 --- a/lib/api/jobs.rb +++ b/lib/api/jobs.rb @@ -54,6 +54,7 @@ module API pipeline = user_project.pipelines.find(params[:pipeline_id]) builds = pipeline.builds builds = filter_builds(builds, params[:scope]) + builds = builds.preload(:job_artifacts_archive) present paginate(builds), with: Entities::Job end |