lib/httpx/plugins/retries.rb in httpx-0.18.0 vs lib/httpx/plugins/retries.rb in httpx-0.18.1
- old
+ new
@@ -10,19 +10,22 @@
module Retries
MAX_RETRIES = 3
# TODO: pass max_retries in a configure/load block
IDEMPOTENT_METHODS = %i[get options head put delete].freeze
- RETRYABLE_ERRORS = [IOError,
- EOFError,
- Errno::ECONNRESET,
- Errno::ECONNABORTED,
- Errno::EPIPE,
- TLSError,
- TimeoutError,
- Parser::Error,
- Errno::EINVAL,
- Errno::ETIMEDOUT].freeze
+ RETRYABLE_ERRORS = [
+ IOError,
+ EOFError,
+ Errno::ECONNRESET,
+ Errno::ECONNABORTED,
+ Errno::EPIPE,
+ Errno::EINVAL,
+ Errno::ETIMEDOUT,
+ Parser::Error,
+ TLSError,
+ TimeoutError,
+ Connection::HTTP2::GoawayError,
+ ].freeze
DEFAULT_JITTER = ->(interval) { interval * (0.5 * (1 + rand)) }
if ENV.key?("HTTPX_NO_JITTER")
def self.extra_options(options)
options.merge(max_retries: MAX_RETRIES)