This plugin adds support for retrying requests when certain errors happen.
Classes and Modules
Constants
DEFAULT_JITTER | = | ->(interval) { interval * ((rand + 1) * 0.5) } | ||
IDEMPOTENT_METHODS | = | %w[GET OPTIONS HEAD PUT DELETE].freeze |
TODO: pass max_retries in a configure/load block |
|
MAX_RETRIES | = | 3 | ||
RETRYABLE_ERRORS | = | [ IOError, EOFError, Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE, Errno::EINVAL, Errno::ETIMEDOUT, Parser::Error, TLSError, TimeoutError, ConnectionError, Connection::HTTP2::GoawayError, ].freeze |
Public Class methods
extra_options(options)
[show source]
# File lib/httpx/plugins/retries.rb 32 def self.extra_options(options) 33 options.merge(max_retries: MAX_RETRIES) 34 end