lib/httpx/plugins/retries.rb in httpx-0.24.7 vs lib/httpx/plugins/retries.rb in httpx-1.0.0
- old
+ new
@@ -86,16 +86,15 @@
if response &&
request.retries.positive? &&
__repeatable_request?(request, options) &&
(
- # rubocop:disable Style/MultilineTernaryOperator
- options.retry_on ?
- options.retry_on.call(response) :
(
response.is_a?(ErrorResponse) && __retryable_error?(response.error)
+ ) ||
+ (
+ options.retry_on && options.retry_on.call(response)
)
- # rubocop:enable Style/MultilineTernaryOperator
)
__try_partial_retry(request, response)
log { "failed to get response, #{request.retries} tries to go..." }
request.retries -= 1
request.transition(:idle)