diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2017-09-22 17:53:08 +0100 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2017-09-22 17:53:08 +0100 |
commit | a1f96aa254000255c6f2100a334726c6d72a53b4 (patch) | |
tree | f9a0374c6a960429ebe888cf877f49901904d46d | |
parent | f9df0e13e3224e90dcddded6d8ae4f1eabc3b6db (diff) | |
download | gitlab-ce-38171-workaround.tar.gz |
Workaround for n+1 in Projects::TreeController#show38171-workaround
See https://gitlab.com/gitlab-org/gitlab-ce/issues/38261
-rw-r--r-- | app/controllers/projects/tree_controller.rb | 5 |
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 |