From fc214953e44bcd7b3fc511ecf391a6ea7df49cc7 Mon Sep 17 00:00:00 2001 From: Anton Sozontov Date: Sun, 9 Oct 2022 01:22:27 +0300 Subject: [PATCH] Don't override given threads number --- lib/async/container/hybrid.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/async/container/hybrid.rb b/lib/async/container/hybrid.rb index 28fb47e..4a27836 100644 --- a/lib/async/container/hybrid.rb +++ b/lib/async/container/hybrid.rb @@ -35,7 +35,7 @@ def run(count: nil, forks: nil, threads: nil, **options, &block) processor_count = Container.processor_count count ||= processor_count ** 2 forks ||= [processor_count, count].min - threads = (count / forks).ceil + threads ||= (count / forks).ceil forks.times do self.spawn(**options) do |instance|