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

See https://gitlab.com/gitlab-org/gitlab-ce/issues/38261
This commit is contained in:
Andrew Newdigate 2017-09-22 17:53:08 +01:00
parent f9df0e13e3
commit a1f96aa254

View file

@ -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