From 87135fce3f6dc6c8beb7ae4090314c8686b3a1de Mon Sep 17 00:00:00 2001 From: Christian Norbert Menges Date: Thu, 14 Dec 2023 13:06:44 +0100 Subject: [PATCH] out_http: Use snake case Signed-off-by: Christian Norbert Menges --- lib/fluent/plugin/out_http.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/fluent/plugin/out_http.rb b/lib/fluent/plugin/out_http.rb index c12df842ff..767f27ca55 100644 --- a/lib/fluent/plugin/out_http.rb +++ b/lib/fluent/plugin/out_http.rb @@ -103,23 +103,23 @@ def initialize @proxy_uri = nil @formatter = nil - @Cache = [] - @CacheIdMutex = Mutex.new - @CacheEntry = Struct.new(:uri, :conn) + @cache = [] + @cache_id_mutex = Mutex.new + @cache_entry = Struct.new(:uri, :conn) end def close super # Close all open connections - @Cache.each {|entry| entry.conn.finish if entry.conn&.started? } + @cache.each {|entry| entry.conn.finish if entry.conn&.started? } end def configure(conf) super - @Cache = Array.new(actual_flush_thread_count, @CacheEntry.new("", nil)) if @reuse_connections - @CacheId = 0 + @cache = Array.new(actual_flush_thread_count, @cache_entry.new("", nil)) if @reuse_connections + @cache_id = 0 if @retryable_response_codes.nil? log.warn('Status code 503 is going to be removed from default `retryable_response_codes` from fluentd v2. Please add it by yourself if you wish') @@ -263,23 +263,23 @@ def create_request(chunk, uri) def make_request_cached(uri, req) id = Thread.current.thread_variable_get(plugin_id) if id.nil? - @CacheIdMutex.synchronize { - id = @CacheId - @CacheId += 1 + @cache_id_mutex.synchronize { + id = @cache_id + @cache_id += 1 } Thread.current.thread_variable_set(plugin_id, id) end uri_str = uri.to_s - if @Cache[id].uri != uri_str - @Cache[id].conn.finish if @Cache[id].conn&.started? + if @cache[id].uri != uri_str + @cache[id].conn.finish if @cache[id].conn&.started? http = if @proxy_uri Net::HTTP.start(uri.host, uri.port, @proxy_uri.host, @proxy_uri.port, @proxy_uri.user, @proxy_uri.password, @http_opt) else Net::HTTP.start(uri.host, uri.port, @http_opt) end - @Cache[id] = @CacheEntry.new(uri_str, http) + @cache[id] = @cache_entry.new(uri_str, http) end - @Cache[id].conn.request(req) + @cache[id].conn.request(req) end def make_request(uri, req)