From 50400bce2653af68ec7987d2908f45bbbb1ec649 Mon Sep 17 00:00:00 2001 From: composer <2789706336@qq.com> Date: Wed, 11 Dec 2024 02:20:15 +0800 Subject: [PATCH] fix: queue --- extension/logstash/lib/logstash/outputs/doris.rb | 2 +- extension/logstash/lib/logstash/util/retry_timer_task.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/logstash/lib/logstash/outputs/doris.rb b/extension/logstash/lib/logstash/outputs/doris.rb index ed8f1aacff0174..20f3af83eb15d0 100644 --- a/extension/logstash/lib/logstash/outputs/doris.rb +++ b/extension/logstash/lib/logstash/outputs/doris.rb @@ -223,7 +223,7 @@ def handle_request(documents, http_headers, event_num, req_count) req_count += 1 @logger.warn("Will do retry #{req_count} after #{sleep_for} secs.") timer_task = RetryTimerTask.new(@retry_queue, @count_block_queue, [documents, http_headers, event_num, req_count]) - @count_block_queue.add(0) + @count_block_queue.put(0) @timer.schedule(timer_task, sleep_for*1000) end diff --git a/extension/logstash/lib/logstash/util/retry_timer_task.rb b/extension/logstash/lib/logstash/util/retry_timer_task.rb index c686a27eb84eab..30c453a3e83bf6 100644 --- a/extension/logstash/lib/logstash/util/retry_timer_task.rb +++ b/extension/logstash/lib/logstash/util/retry_timer_task.rb @@ -28,6 +28,6 @@ def initialize(retry_queue, count_block_queue, event) def run @retry_queue << @event - @count_block_queue.pull + @count_block_queue.poll end end