lib/dor/services/client.rb in dor-services-client-7.12.0 vs lib/dor/services/client.rb in dor-services-client-8.0.0
- old
+ new
@@ -5,10 +5,11 @@
require 'active_support/core_ext/object/blank'
require 'active_support/json'
require 'active_support/core_ext/object/json'
require 'cocina/models'
require 'faraday'
+require 'faraday/retry'
require 'singleton'
require 'zeitwerk'
loader = Zeitwerk::Loader.new
loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
@@ -124,11 +125,11 @@
Faraday.new(url) do |builder|
builder.use ErrorFaradayMiddleware
builder.use Faraday::Request::UrlEncoded
# @note when token & token_header are nil, this line is required else
- # the Faraday instance will be passed an empty block, which
- # causes the adapter not to be set. Thus, everything breaks.
+ # the Faraday instance will be passed an empty block, which
+ # causes the adapter not to be set. Thus, everything breaks.
builder.adapter Faraday.default_adapter
builder.headers[:user_agent] = user_agent
builder.headers[TOKEN_HEADER] = "Bearer #{token}"
builder.request :retry, max: 4, interval: 1, backoff_factor: 2 if with_retries
end