Skip to content

Commit

Permalink
Ensure workers to 1 when target_worker_ids nil or false
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Feb 21, 2019
1 parent 44f206a commit 44b67c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/fluent/plugin/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 44b67c9

Please sign in to comment.