File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 55
66module InfluxDB
77 # rubocop:disable Metrics/MethodLength
8+ # rubocop:disable Metrics/ModuleLength
89 # rubocop:disable Metrics/AbcSize
910 module HTTP # :nodoc:
1011 def get ( url , options = { } )
@@ -43,7 +44,7 @@ def connect_with_retry
4344 delay = config . initial_delay
4445 retry_count = 0
4546
46- http = get_http
47+ http = current_http
4748
4849 begin
4950 http . start unless http . started?
@@ -135,14 +136,14 @@ def generate_cert_store
135136 store
136137 end
137138
138- def get_http
139+ def current_http
139140 return build_http config . next_host unless config . persistent
140141
141142 @https ||=
142143 begin
143- https = config . hosts . map { |host |
144+ https = config . hosts . map do |host |
144145 build_http host
145- }
146+ end
146147
147148 Hash [ config . hosts . zip ( https ) ]
148149 end
Original file line number Diff line number Diff line change 11require "uri"
22
3+ # :rubocop:disable Metrics/ClassLength
4+
35module InfluxDB
46 # DEFAULT_CONFIG_OPTIONS maps (most) of the configuration options to
57 # their default value. Each option (except for "async" and "udp") can
Original file line number Diff line number Diff line change 6060 end
6161 end
6262
63- describe "#get_http " do
63+ describe "#current_http " do
6464 it "returns an existing connection with persistence enabled" do
65- first = subject . send :get_http
66- second = subject . send :get_http
65+ first = subject . send :current_http
66+ second = subject . send :current_http
6767
6868 expect ( first ) . to equal ( second )
6969 end
7070
7171 it "returns a new connection with persistence disabled" do
7272 subject . config . persistent = false
7373
74- first = subject . send :get_http
75- second = subject . send :get_http
74+ first = subject . send :current_http
75+ second = subject . send :current_http
7676
7777 expect ( first ) . to_not equal ( second )
7878 end
You can’t perform that action at this time.
0 commit comments