From 44b67c99290cc29eedb5717edf31cb6b7172310f Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Thu, 21 Feb 2019 12:49:11 +0900 Subject: [PATCH] Ensure workers to 1 when target_worker_ids nil or false Signed-off-by: Hiroshi Hatake --- lib/fluent/plugin/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/base.rb b/lib/fluent/plugin/base.rb index 1e1e785ac3..70ded69bd3 100644 --- a/lib/fluent/plugin/base.rb +++ b/lib/fluent/plugin/base.rb @@ -52,7 +52,11 @@ def fluentd_worker_id def configure(conf) if conf.respond_to?(:for_this_worker?) && conf.for_this_worker? - workers = conf.target_worker_ids.size || 1 + workers = if conf.target_worker_ids && !conf.target_worker_ids.empty? + conf.target_worker_ids.size + else + 1 + end system_config_override(workers: workers) end super