Commit 94639115 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 5c89a2e5 d8b361af
......@@ -94,7 +94,7 @@ class Commit
end
def lazy(project, oid)
BatchLoader.for({ project: project, oid: oid }).batch do |items, loader|
BatchLoader.for({ project: project, oid: oid }).batch(replace_methods: false) do |items, loader|
items_by_project = items.group_by { |i| i[:project] }
items_by_project.each do |project, commit_ids|
......
---
title: Speed up commit loads by disabling BatchLoader replace_methods
merge_request: 29633
author:
type: performance
......@@ -44,6 +44,14 @@ describe Commit do
expect(commit.id).to eq(oids[i])
end
end
it 'does not attempt to replace methods via BatchLoader' do
subject.each do |commit|
expect(commit).to receive(:method_missing).and_call_original
commit.id
end
end
end
context 'when not found' do
......
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