lib/zold/node/farm.rb in zold-0.14.13 vs lib/zold/node/farm.rb in zold-0.14.14

- old
+ new

@@ -74,10 +74,11 @@ @log.info('Zero-threads farm won\'t score anything!') if threads.zero? cleanup(host, port, strength, threads) @log.info("#{@pipeline.size} scores pre-loaded, the best is: #{best[0]}") @threads = (1..threads).map do |t| Thread.new do + Thread.current.abort_on_exception = true Thread.current.name = "f#{t}" Thread.current.priority = -100 loop do VerboseThread.new(@log).run do cycle(host, port, strength, threads) @@ -85,10 +86,12 @@ end end end alive = true @cleanup = Thread.new do + Thread.current.abort_on_exception = true Thread.current.name = 'cleanup' + Thread.current.priority = -100 while alive sleep(60) unless strength == 1 # which will only happen in tests VerboseThread.new(@log).run do cleanup(host, port, strength, threads) end