diff --git a/lib/http_client.rb b/lib/http_client.rb index 01d702298..686c8fa53 100644 --- a/lib/http_client.rb +++ b/lib/http_client.rb @@ -4,6 +4,17 @@ module HttpClient def self.new(url = nil, options = {}) + default_options = { + request: { + read_timeout: 5, + open_timeout: 5, + write_timeout: 5, + timeout: 10 + } + } + + options = default_options.deep_merge(options) + Faraday.new(url, options) do |f| f.use RecordRequestHostInErrors yield f