Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max_retries support #660

Merged
merged 2 commits into from
Aug 30, 2019

Conversation

dilumn
Copy link
Contributor

@dilumn dilumn commented Jul 8, 2019

Net::HTTP had this weird behaviour of retry once on timeout for GET & PUT requests. On Ruby 2.5.0 Net::HTTP introduced retry configuration option ruby/ruby#1654

Found out that HTTParty doesn't support it yet. I added max_retries option pass to Net::HTTP from ConnectionAdapter

@TheSmartnik
Copy link
Collaborator

@dilumn from the first glance it looks good, thanks! I'll take a closer look and test it in the weekend and get back to you! Feel free to ping me, if you want here from me in a week

@dilumn
Copy link
Contributor Author

dilumn commented Jul 9, 2019

@TheSmartnik thanks for the quick response for the PR

You can easily reproduce/test this behaviour using a simple sinatra app like

require 'sinatra'

set :server_settings, :timeout => 500


get '/' do
  puts "received"
  sleep 50 
  puts "sent"
  'Hello world!'
end

Do you have any timeline for the next release?

@dilumn
Copy link
Contributor Author

dilumn commented Aug 27, 2019

@TheSmartnik did you have any free time to have a look at this pull request??

@TheSmartnik
Copy link
Collaborator

@dilumn thanks a lot both for pr and reproduction steps. Works great

@TheSmartnik TheSmartnik merged commit b9a54d8 into jnunemaker:master Aug 30, 2019
@oshanz
Copy link

oshanz commented Nov 7, 2019

Thanks @dilumn 🤗

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

Successfully merging this pull request may close these issues.

3 participants