summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Newdigate <andrew@gitlab.com>2017-09-22 18:54:35 +0000
committerRobert Speicher <robert@gitlab.com>2017-09-22 18:54:35 +0000
commit9f71ea0d4d0ace4b30e4191cceba8c71f5fad435 (patch)
tree86f85e6765ca9cf700c6ab3b7af77457cfe4b721
parente85e803c0eb6e48dfd9228e718190d95ededf9b1 (diff)
downloadgitlab-ce-9f71ea0d4d0ace4b30e4191cceba8c71f5fad435.tar.gz
Workaround for #38259
-rw-r--r--lib/gitlab/data_builder/push.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/data_builder/push.rb b/lib/gitlab/data_builder/push.rb
index 4ab5b3455a5..31a46a738c3 100644
--- a/lib/gitlab/data_builder/push.rb
+++ b/lib/gitlab/data_builder/push.rb
@@ -64,8 +64,11 @@ module Gitlab
# For performance purposes maximum 20 latest commits
# will be passed as post receive hook data.
- commit_attrs = commits_limited.map do |commit|
- commit.hook_attrs(with_changed_files: true)
+ # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/38259
+ commit_attrs = Gitlab::GitalyClient.allow_n_plus_1_calls do
+ commits_limited.map do |commit|
+ commit.hook_attrs(with_changed_files: true)
+ end
end
type = Gitlab::Git.tag_ref?(ref) ? 'tag_push' : 'push'