Commit 40081c42 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch 'sh-fix-gitaly-cleanup-service-durations' into 'master'

Fix Gitaly duration timings for ApplyBfgObjectMapStreamRequest

See merge request gitlab-org/gitlab!34907
parents 511a7f11 3eafb563
...@@ -13,15 +13,15 @@ module Gitlab ...@@ -13,15 +13,15 @@ module Gitlab
end end
def apply_bfg_object_map_stream(io, &blk) def apply_bfg_object_map_stream(io, &blk)
responses = GitalyClient.call( GitalyClient.streaming_call(
storage, storage,
:cleanup_service, :cleanup_service,
:apply_bfg_object_map_stream, :apply_bfg_object_map_stream,
build_object_map_enum(io), build_object_map_enum(io),
timeout: GitalyClient.long_timeout timeout: GitalyClient.long_timeout
) ) do |response|
response.each(&blk)
responses.each(&blk) end
end end
private private
......
...@@ -22,5 +22,11 @@ RSpec.describe Gitlab::GitalyClient::CleanupService do ...@@ -22,5 +22,11 @@ RSpec.describe Gitlab::GitalyClient::CleanupService do
client.apply_bfg_object_map_stream(StringIO.new) client.apply_bfg_object_map_stream(StringIO.new)
end end
it 'is wrapped as a streaming call' do
expect(Gitlab::GitalyClient).to receive(:streaming_call).with(anything, :cleanup_service, :apply_bfg_object_map_stream, anything, anything)
client.apply_bfg_object_map_stream(StringIO.new)
end
end 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