lib/zold/node/farm.rb in zold-0.14.17 vs lib/zold/node/farm.rb in zold-0.14.18

- old
+ new

@@ -76,11 +76,10 @@ @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) end end @@ -88,11 +87,10 @@ 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 @@ -145,9 +143,12 @@ return unless s.host == host return unless s.port == port return unless s.strength >= strength Thread.current.name = s.to_mnemo save(threads, [s.next]) + # score = Score.parse(`ruby #{File.join(File.dirname(__FILE__), '../../../bin/zold')} next "#{s}"`) + # @log.debug("New score discovered: #{score}") + # save(threads, [score]) cleanup(host, port, strength, threads) end def save(threads, list = []) scores = load + list