From 3abd9eb7b545d04d6371dbbc239a692a227b5c4d Mon Sep 17 00:00:00 2001 From: OlehPalanskyi Date: Fri, 26 Apr 2024 01:03:48 +0300 Subject: [PATCH] rewritten retry state with the above recommendations in mind. Signed-off-by: Oleh Signed-off-by: OlehPalanskyi --- lib/fluent/plugin/in_opensearch.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/fluent/plugin/in_opensearch.rb b/lib/fluent/plugin/in_opensearch.rb index 692c8fd..3b98712 100644 --- a/lib/fluent/plugin/in_opensearch.rb +++ b/lib/fluent/plugin/in_opensearch.rb @@ -349,8 +349,10 @@ def update_retry_state(error=nil) log.warn("failed to connect or search.", retry_times: @retry.steps, next_retry_time: @retry.next_time.round, error: error.message) sleep(@retry.next_time - Time.now) else - log.debug("retry succeeded.") unless @retry.nil? - @retry = nil unless @retry.nil? + unless @retry.nil? + log.debug("retry succeeded.") + @retry = nil + end end end