Commit ff73b6be authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'id-remove-blobs_fetch_in_batches-feature-flag' into 'master'

Remove blobs_fetch_in_batches feature flag

See merge request gitlab-org/gitlab!29069
parents b0418304 6a5aa584
---
title: Remove blobs_fetch_in_batches feature flag
merge_request: 29069
author:
type: added
......@@ -86,12 +86,8 @@ module Gitlab
# to the caller to limit the number of blobs and blob_size_limit.
#
def batch(repository, blob_references, blob_size_limit: MAX_DATA_DISPLAY_SIZE)
if Feature.enabled?(:blobs_fetch_in_batches, default_enabled: true)
blob_references.each_slice(BATCH_SIZE).flat_map do |refs|
repository.gitaly_blob_client.get_blobs(refs, blob_size_limit).to_a
end
else
repository.gitaly_blob_client.get_blobs(blob_references, blob_size_limit).to_a
blob_references.each_slice(BATCH_SIZE).flat_map do |refs|
repository.gitaly_blob_client.get_blobs(refs, blob_size_limit).to_a
end
end
......
......@@ -301,26 +301,12 @@ describe Gitlab::Git::Blob, :seed_helper do
stub_const('Gitlab::Git::Blob::BATCH_SIZE', 2)
end
context 'blobs_fetch_in_batches is enabled' do
it 'fetches the blobs in batches' do
expect(client).to receive(:get_blobs).with(first_batch, limit).ordered
expect(client).to receive(:get_blobs).with(second_batch, limit).ordered
expect(client).to receive(:get_blobs).with(third_batch, limit).ordered
it 'fetches the blobs in batches' do
expect(client).to receive(:get_blobs).with(first_batch, limit).ordered
expect(client).to receive(:get_blobs).with(second_batch, limit).ordered
expect(client).to receive(:get_blobs).with(third_batch, limit).ordered
subject
end
end
context 'blobs_fetch_in_batches is disabled' do
before do
stub_feature_flags(blobs_fetch_in_batches: false)
end
it 'fetches the blobs in a single batch' do
expect(client).to receive(:get_blobs).with(blob_references, limit)
subject
end
subject
end
end
end
......
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