File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
lib/elasticsearch/transport Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Features overview:
2929
3030For optimal performance, you should use a HTTP library which supports persistent ("keep-alive") connections,
3131e.g. [ Patron] ( https://github.com/toland/patron ) or [ Typhoeus] ( https://github.com/typhoeus/typhoeus ) .
32- Just ` require 'patron' ` or ` require 'typhoeus'; require 'typhoeus/adapters/faraday' ` in your code,
32+ Just ` require 'patron' ` or ` require 'typhoeus' ` in your code,
3333and it will be automatically used; other automatically used libraries are
3434[ HTTPClient] ( https://rubygems.org/gems/httpclient ) and
3535[ Net::HTTP::Persistent] ( https://rubygems.org/gems/net-http-persistent ) .
Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ def initialize(arguments={})
9999 @transport = arguments [ :transport ] || begin
100100 if transport_class == Transport ::HTTP ::Faraday
101101 transport_class . new ( :hosts => __extract_hosts ( hosts , arguments ) , :options => arguments ) do |faraday |
102- faraday . adapter ( arguments [ :adapter ] || __auto_detect_adapter )
102+ adapter = arguments [ :adapter ] || __auto_detect_adapter
103+ require "typhoeus/adapters/faraday" if adapter == :typhoeus
104+ faraday . adapter ( adapter )
103105 end
104106 else
105107 transport_class . new ( :hosts => __extract_hosts ( hosts , arguments ) , :options => arguments )
You can’t perform that action at this time.
0 commit comments