Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Add read_timeout option to UriAdapter download_content method #2232

Merged
merged 3 commits into from
Jun 16, 2016

Conversation

droptheplot
Copy link
Contributor

Net::ReadTimeout exception will occur if remote file couldn't be reached within default timeout.
This PR adds option :read_timeout to Paperclip to override default open timeout from UriAdapter download_content method.
#1923

@subject.expects(:open).with(@uri, read_timeout: 240).at_least_once
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at block body end.

@@ -99,4 +99,31 @@
end
end

describe "#download_content" do
before do
Paperclip::UriAdapter.any_instance.stubs(:open).returns(StringIO.new("xxx"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [82/80]

@tute
Copy link
Contributor

tute commented Jun 16, 2016

Great! Want to add a note in the NEWS file documenting your addition? Then we'll merge. Thanks!

@droptheplot
Copy link
Contributor Author

Done.

@tute tute merged commit 431d1e8 into thoughtbot:master Jun 16, 2016
@tute
Copy link
Contributor

tute commented Jun 16, 2016

Thanks! 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants