Merged PR #2440 - Request timeout while importing large attachments from Zendesk (thanks a lot to @anuzhin 😍).

This commit is contained in:
Billy Zhou 2019-01-23 23:02:45 +08:00 committed by Thorsten Eckel
parent 175db6f123
commit 9d8ce06948
2 changed files with 34 additions and 2 deletions

View file

@ -36,8 +36,8 @@ class Sequencer
resource.content_url,
{},
{
open_timeout: 10,
read_timeout: 60,
open_timeout: 20,
read_timeout: 240,
},
)
end

View file

@ -0,0 +1,32 @@
require 'rails_helper'
RSpec.describe Sequencer::Unit::Import::Zendesk::Ticket::Comment::Attachment::Request, sequencer: :unit do
context 'when fetching large attachements from Zendesk' do
before(:all) do
described_class.class_eval do
private
def failed?
false
end
end
end
def mock_parameters
{
resource: double(
content_url: ''
)
}
end
it 'open timeout should be 20s and read timeout should be 240s' do
expect(UserAgent).to receive(:get).with(any_args, { open_timeout: 20, read_timeout: 240 })
process(mock_parameters)
end
end
end