Skip to content

Commit

Permalink
Merge pull request #213 from Meat-Chopper/persistent_v4
Browse files Browse the repository at this point in the history
Support Net::HTTP::Persistent v4
  • Loading branch information
rogerleite committed Nov 16, 2020
2 parents 91d2d19 + 8482304 commit 497a304
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/httpi/adapter/net_http_persistent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class NetHTTPPersistent < NetHTTP
private

def create_client
if is_v3
if Gem::Version.new(Net::HTTP::Persistent::VERSION) >= Gem::Version.new('3.0.0')
Net::HTTP::Persistent.new name: thread_key
else
Net::HTTP::Persistent.new thread_key
Expand Down Expand Up @@ -42,11 +42,6 @@ def setup_client
def thread_key
@request.url.host.split(/\W/).reject{|p|p == ""}.join('-')
end

def is_v3
Net::HTTP::Persistent::VERSION.start_with? "3."
end

end
end
end

0 comments on commit 497a304

Please sign in to comment.