lib/zold/remotes.rb in zold-0.14.11 vs lib/zold/remotes.rb in zold-0.14.12
- old
+ new
@@ -181,12 +181,14 @@
return if all.empty?
best = farm.best[0]
require_relative 'score'
score = best.nil? ? Score::ZERO : best
idx = 0
- pool = Concurrent::FixedThreadPool.new([all.count, Concurrent.processor_count * 16].min, max_queue: 0)
+ pool = Concurrent::FixedThreadPool.new([all.count, Concurrent.processor_count * 4].min, max_queue: 0)
all.each do |r|
pool.post do
+ Thread.current.name = 'remotes'
+ Thread.current.priority = -100
start = Time.now
begin
yield Remotes::Remote.new(r[:host], r[:port], score, idx, log: log, network: @network)
idx += 1
raise 'Took too long to execute' if (Time.now - start).round > Remotes::RUNTIME_LIMIT