From a72a636074ee0c7c4376a8baa32cdde3be2a0def Mon Sep 17 00:00:00 2001 From: TAGOMORI Satoshi Date: Tue, 24 May 2016 14:45:15 +0900 Subject: [PATCH] fix bug for variable "timekey" and others --- lib/fluent/plugin/output.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/fluent/plugin/output.rb b/lib/fluent/plugin/output.rb index cc196836cf..c2ac7dc0c0 100644 --- a/lib/fluent/plugin/output.rb +++ b/lib/fluent/plugin/output.rb @@ -915,10 +915,10 @@ def enqueue_thread_run end if @chunk_key_time - timekey = @buffer_config.timekey + timekey_unit = @buffer_config.timekey timekey_wait = @buffer_config.timekey_wait - current_timekey = now_int - now_int % timekey - @buffer.enqueue_all{ |metadata, chunk| metadata.timekey < current_time_range && metadata.timekey + timekey + timekey_wait <= now_int } + current_timekey = now_int - now_int % timekey_unit + @buffer.enqueue_all{ |metadata, chunk| metadata.timekey < current_timekey && metadata.timekey + timekey_unit + timekey_wait <= now_int } end rescue => e log.error "unexpected error while checking flushed chunks. ignored.", plugin_id: plugin_id, error_class: e.class, error: e