summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-09-22 21:47:50 +0000
committerRobert Speicher <robert@gitlab.com>2017-09-22 21:47:50 +0000
commit024d10b7adabe4ca2fc42107837367cb086fe75c (patch)
tree92cd9aa44c465743c8ddca3cc3640539c99226e9
parent7cf8e0981ad2492fb26c8f9b232bf548b383b08b (diff)
parenta1f96aa254000255c6f2100a334726c6d72a53b4 (diff)
downloadgitlab-ce-024d10b7adabe4ca2fc42107837367cb086fe75c.tar.gz
Merge branch '38171-workaround' into 'master'
Workaround for n+1 in Projects::TreeController#show Closes #38171 See merge request gitlab-org/gitlab-ce!14455
-rw-r--r--app/controllers/projects/tree_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb
index 1fc276b8c03..f3784f4e07c 100644
--- a/app/controllers/projects/tree_controller.rb
+++ b/app/controllers/projects/tree_controller.rb
@@ -35,7 +35,10 @@ class Projects::TreeController < Projects::ApplicationController
end
format.json do
- render json: TreeSerializer.new(project: @project, repository: @repository, ref: @ref).represent(@tree)
+ # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/38261
+ Gitlab::GitalyClient.allow_n_plus_1_calls do
+ render json: TreeSerializer.new(project: @project, repository: @repository, ref: @ref).represent(@tree)
+ end
end
end
end