From a1b9913a8b93d6700588f6e013e9a119557f3c5d Mon Sep 17 00:00:00 2001 From: abetomo Date: Fri, 10 Mar 2023 19:56:34 +0900 Subject: [PATCH] Improve conditions * Change of order * Use `conf.for_every_workers?` instead of `conf.target_worker_ids.empty?`. Signed-off-by: abetomo --- lib/fluent/plugin/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/base.rb b/lib/fluent/plugin/base.rb index aa1ff16ab9..b0cee6ca03 100644 --- a/lib/fluent/plugin/base.rb +++ b/lib/fluent/plugin/base.rb @@ -55,7 +55,7 @@ def fluentd_worker_id def configure(conf) raise ArgumentError, "BUG: type of conf must be Fluent::Config::Element, but #{conf.class} is passed." unless conf.is_a?(Fluent::Config::Element) - if (Fluent::Engine.supervisor_mode && !conf.target_worker_ids.empty?) || conf.for_this_worker? + if conf.for_this_worker? || (Fluent::Engine.supervisor_mode && !conf.for_every_workers?) system_config_override(workers: conf.target_worker_ids.size) end