Skip to content

Commit

Permalink
Only set max_retries if Ruby version is >= 2.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
smaeda-ks committed Dec 9, 2019
1 parent f8c5c77 commit d2b4884
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/twurl/oauth_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def configure_http!
consumer.http.set_debug_output(Twurl.options.debug_output_io) if Twurl.options.trace
consumer.http.read_timeout = consumer.http.open_timeout = Twurl.options.timeout || 60
consumer.http.open_timeout = Twurl.options.connection_timeout if Twurl.options.connection_timeout
consumer.http.max_retries = 0 # default is 1
# Only override if Net::HTTP support max_retries (since Ruby >= 2.5)
consumer.http.max_retries = 0 if consumer.http.respond_to?(:max_retries=)
if Twurl.options.ssl?
consumer.http.use_ssl = true
consumer.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
Expand Down

0 comments on commit d2b4884

Please sign in to comment.