Skip to content

Commit 39a270d

Browse files
default to noop license checker opon no-arg build_client
1 parent 47c367c commit 39a270d

File tree

1 file changed

+3
-10
lines changed
  • lib/logstash/outputs/elasticsearch/http_client

1 file changed

+3
-10
lines changed

lib/logstash/outputs/elasticsearch/http_client/pool.rb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "logstash/outputs/elasticsearch/license_check"
2+
13
module LogStash; module Outputs; class ElasticSearch; class HttpClient;
24
class Pool
35
class NoConnectionAvailableError < Error; end
@@ -68,16 +70,7 @@ def initialize(logger, adapter, initial_urls=[], options={})
6870
@url_info = {}
6971
@stopping = false
7072

71-
if options[:license_checker].nil?
72-
# v7 BWC: if a license_checker option was not provided use the plugin local
73-
# license checker class in logstash/outputs/elasticsearch/license_check.rb
74-
# normally this class is passed from the Commons#build_client method to allow
75-
# alternate license checking logic from other implementations like the data streams output.
76-
require "logstash/outputs/elasticsearch/license_check"
77-
@license_checker = LogStash::ElasticSearchOutputLicenseChecker.new(logger)
78-
else
79-
@license_checker = options[:license_checker]
80-
end
73+
@license_checker = options.fetch(:license_checker) { LogStash::NoopLicenseChecker::INSTANCE }
8174
end
8275

8376
def start

0 commit comments

Comments
 (0)