summaryrefslogtreecommitdiff
path: root/lib/gitlab/diff
diff options
context:
space:
mode:
authorAndrew Newdigate <andrew@gitlab.com>2017-09-19 10:55:37 +0000
committerRémy Coutable <remy@rymai.me>2017-09-19 10:55:37 +0000
commit64d7ec0a9e3ffd6233ccfbe9100f8a9391c648e5 (patch)
tree2cc89bc2d1087eb145918c6ae8cbf70878d40e97 /lib/gitlab/diff
parent39dd7736585d3e35d5c6f391e6a94c312da09056 (diff)
downloadgitlab-ce-64d7ec0a9e3ffd6233ccfbe9100f8a9391c648e5.tar.gz
Detect n+1 issues involving Gitaly
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/file_collection/base.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/diff/file_collection/base.rb b/lib/gitlab/diff/file_collection/base.rb
index a6007ebf531..88ae65cb468 100644
--- a/lib/gitlab/diff/file_collection/base.rb
+++ b/lib/gitlab/diff/file_collection/base.rb
@@ -22,7 +22,10 @@ module Gitlab
end
def diff_files
- @diff_files ||= @diffs.decorate! { |diff| decorate_diff!(diff) }
+ # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37445
+ Gitlab::GitalyClient.allow_n_plus_1_calls do
+ @diff_files ||= @diffs.decorate! { |diff| decorate_diff!(diff) }
+ end
end
def diff_file_with_old_path(old_path)