Permalink
Browse files

Workaround for n+1 in Projects::TreeController#show

  • Loading branch information...
suprememoocow committed Sep 22, 2017
1 parent f9df0e1 commit a1f96aa254000255c6f2100a334726c6d72a53b4
Showing with 4 additions and 1 deletion.
  1. +4 −1 app/controllers/projects/tree_controller.rb
@@ -35,7 +35,10 @@ def show
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

0 comments on commit a1f96aa

Please sign in to comment.