We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50b6642 commit 74836efCopy full SHA for 74836ef
lib/matrixeval/ruby/runner.rb
@@ -145,7 +145,8 @@ def report
145
def parallel
146
contexts = Context.all
147
148
- contexts.each_slice(contexts.count / workers_count) do |sub_contexts|
+ per_worker_contexts_count = [(contexts.count / workers_count), 1].max
149
+ contexts.each_slice(per_worker_contexts_count) do |sub_contexts|
150
threads << Thread.new do
151
yield sub_contexts
152
end
0 commit comments