Allow Gitaly N+1 queries in MR CreationsController

Fixes a master failure due to a reduction in
the accepted Gitaly query count.
This commit is contained in:
Luke Bennett 2019-02-22 21:10:06 +00:00
parent 7e37b4e4ef
commit 10ca351dd5
No known key found for this signature in database
GPG key ID: 402ED51FB5D306C2

View file

@ -89,7 +89,11 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap
def build_merge_request
params[:merge_request] ||= ActionController::Parameters.new(source_project: @project)
@merge_request = ::MergeRequests::BuildService.new(project, current_user, merge_request_params.merge(diff_options: diff_options)).execute
# Gitaly N+1 issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/58096
Gitlab::GitalyClient.allow_n_plus_1_calls do
@merge_request = ::MergeRequests::BuildService.new(project, current_user, merge_request_params.merge(diff_options: diff_options)).execute
end
end
def define_new_vars