sumoheavy / jira-ruby

A Ruby gem for the JIRA REST API
MIT License
654 stars 412 forks source link

Allow overriding Net::HTTP max_retries #401

Closed spikex closed 4 months ago

spikex commented 1 year ago

Net::HTTP automatically "[retries] idempotent request in case of Net::ReadTimeout, IOError, EOFError, Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE, OpenSSL::SSL::SSLError, Timeout::Error." The default is a one retry. Idempotent is defined as IDEMPOTENT_METHODS_ = %w/GET HEAD PUT DELETE OPTIONS TRACE/

https://ruby-doc.org/stdlib-2.7.1/libdoc/net/http/rdoc/Net/HTTP.html#method-i-max_retries-3D

This pull request exposes the max_retries method to allow overriding the default, either disabling, by setting max_retries to 0, or increasing the number of retries.