Commit 53b16dda authored by Stan Hu's avatar Stan Hu

Merge branch 'gitaly-np1-mr-creations' into 'master'

EE Allow Gitaly N+1 in MR CreationsController

Closes #9917

See merge request gitlab-org/gitlab-ee!9671
parents 16fe447d 7f024522
...@@ -89,8 +89,12 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap ...@@ -89,8 +89,12 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap
def build_merge_request def build_merge_request
params[:merge_request] ||= ActionController::Parameters.new(source_project: @project) params[:merge_request] ||= ActionController::Parameters.new(source_project: @project)
# 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 @merge_request = ::MergeRequests::BuildService.new(project, current_user, merge_request_params.merge(diff_options: diff_options)).execute
end end
end
def define_new_vars def define_new_vars
@noteable = @merge_request @noteable = @merge_request
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment