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 5
5
6
6
module InfluxDB
7
7
# rubocop:disable Metrics/MethodLength
8
+ # rubocop:disable Metrics/ModuleLength
8
9
# rubocop:disable Metrics/AbcSize
9
10
module HTTP # :nodoc:
10
11
def get ( url , options = { } )
@@ -43,7 +44,7 @@ def connect_with_retry
43
44
delay = config . initial_delay
44
45
retry_count = 0
45
46
46
- http = get_http
47
+ http = current_http
47
48
48
49
begin
49
50
http . start unless http . started?
@@ -135,14 +136,14 @@ def generate_cert_store
135
136
store
136
137
end
137
138
138
- def get_http
139
+ def current_http
139
140
return build_http config . next_host unless config . persistent
140
141
141
142
@https ||=
142
143
begin
143
- https = config . hosts . map { |host |
144
+ https = config . hosts . map do |host |
144
145
build_http host
145
- }
146
+ end
146
147
147
148
Hash [ config . hosts . zip ( https ) ]
148
149
end
Original file line number Diff line number Diff line change 1
1
require "uri"
2
2
3
+ # :rubocop:disable Metrics/ClassLength
4
+
3
5
module InfluxDB
4
6
# DEFAULT_CONFIG_OPTIONS maps (most) of the configuration options to
5
7
# their default value. Each option (except for "async" and "udp") can
Original file line number Diff line number Diff line change 60
60
end
61
61
end
62
62
63
- describe "#get_http " do
63
+ describe "#current_http " do
64
64
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
67
67
68
68
expect ( first ) . to equal ( second )
69
69
end
70
70
71
71
it "returns a new connection with persistence disabled" do
72
72
subject . config . persistent = false
73
73
74
- first = subject . send :get_http
75
- second = subject . send :get_http
74
+ first = subject . send :current_http
75
+ second = subject . send :current_http
76
76
77
77
expect ( first ) . to_not equal ( second )
78
78
end
You can’t perform that action at this time.
0 commit comments