lib/stream/client.rb in stream-ruby-4.4.0 vs lib/stream/client.rb in stream-ruby-4.5.0

- old
+ new

@@ -1,6 +1,7 @@ require 'faraday' +require 'faraday/net_http_persistent' require 'stream/errors' require 'stream/feed' require 'stream/signer' require 'stream/url' @@ -168,10 +169,13 @@ @options = url_generator.options @conn = Faraday.new(url: url_generator.url) do |faraday| faraday.use RaiseHttpException faraday.options[:open_timeout] = @options[:default_timeout] faraday.options[:timeout] = @options[:default_timeout] - faraday.adapter Faraday.default_adapter + faraday.adapter :net_http_persistent, pool_size: 5 do |http| + # AWS load balancer idle timeout is 60 secs, so let's make it 59 + http.idle_timeout = 59 + end end @base_path = url_generator.base_path @conn.path_prefix = base_path end