diff options
author | Stan Hu <stanhu@gmail.com> | 2017-03-31 22:12:34 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-04-02 05:40:23 -0700 |
commit | 66f91aac7070b01bd9038ddeee96a5f9ec35d858 (patch) | |
tree | 885bb595b9fb815c84a24a0d69dcdcc7d0a4e366 | |
parent | 9fc17f6f4abdb04f3cf1b60b87bd67b894a19c39 (diff) | |
download | gitlab-ce-66f91aac7070b01bd9038ddeee96a5f9ec35d858.tar.gz |
Fix N+1 query in loading pipelines in merge requests
From Bullet failures in !10263
-rw-r--r-- | app/models/ci/pipeline.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index f12be98c80c..ad7e0b23ff4 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -210,7 +210,7 @@ module Ci end def stuck? - builds.pending.any?(&:stuck?) + builds.pending.includes(:project).any?(&:stuck?) end def retryable? |