summaryrefslogtreecommitdiff
path: root/app/controllers/projects/merge_requests/diffs_controller.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-11-03 14:16:43 +0100
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-11-21 13:53:26 +0100
commitf9565e303916ca194ef63b5fd3de541bf1c2a170 (patch)
tree7361a9ebf56afdbcc198f5b2fa84779d4ba752a4 /app/controllers/projects/merge_requests/diffs_controller.rb
parent6dd89059b8d4ed412313067aab44a1969558b687 (diff)
downloadgitlab-ce-f9565e303916ca194ef63b5fd3de541bf1c2a170.tar.gz
Batchload blobs for diff generation
After installing a new gem, batch-loader, a construct can be used to queue data to be fetched in bulk. The gem was also introduced in both gitlab-org/gitlab-ce!14680 and gitlab-org/gitlab-ce!14846, but those mrs are not merged yet. For the generation of diffs, both the old blob and the new blob need to be loaded. This for every file in the diff, too. Now we collect all these so we do 1 fetch. Three `.allow_n_plus_1_calls` have been removed, which I expect to be valid, but this needs to be confirmed by a full CI run. Possibly closes: - https://gitlab.com/gitlab-org/gitlab-ce/issues/37445 - https://gitlab.com/gitlab-org/gitlab-ce/issues/37599 - https://gitlab.com/gitlab-org/gitlab-ce/issues/37431
Diffstat (limited to 'app/controllers/projects/merge_requests/diffs_controller.rb')
-rw-r--r--app/controllers/projects/merge_requests/diffs_controller.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/app/controllers/projects/merge_requests/diffs_controller.rb b/app/controllers/projects/merge_requests/diffs_controller.rb
index 7d16e77ef66..d60a24d3f1d 100644
--- a/app/controllers/projects/merge_requests/diffs_controller.rb
+++ b/app/controllers/projects/merge_requests/diffs_controller.rb
@@ -10,10 +10,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
def show
@environment = @merge_request.environments_for(current_user).last
- # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37431
- Gitlab::GitalyClient.allow_n_plus_1_calls do
- render json: { html: view_to_html_string("projects/merge_requests/diffs/_diffs") }
- end
+ render json: { html: view_to_html_string("projects/merge_requests/diffs/_diffs") }
end
def diff_for_path