Merged PR #2440 - Request timeout while importing large attachments from Zendesk (thanks a lot to @anuzhin 😍).
This commit is contained in:
parent
175db6f123
commit
9d8ce06948
2 changed files with 34 additions and 2 deletions
|
@ -36,8 +36,8 @@ class Sequencer
|
||||||
resource.content_url,
|
resource.content_url,
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
open_timeout: 10,
|
open_timeout: 20,
|
||||||
read_timeout: 60,
|
read_timeout: 240,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
Loading…
Reference in a new issue