lib/zold/node/farmers.rb in zold-0.16.17 vs lib/zold/node/farmers.rb in zold-0.16.18

- old
+ new

@@ -69,11 +69,11 @@ begin stdin.close buffer = +'' loop do begin - buffer << stdout.read_nonblock(1024) + buffer << stdout.read_nonblock(16 * 1024) # rubocop:disable Lint/HandleExceptions rescue IO::WaitReadable => _ # rubocop:enable Lint/HandleExceptions # nothing to do here rescue StandardError => e @@ -83,10 +83,10 @@ break if buffer.end_with?("\n") && thr.value.to_i.zero? if stdout.closed? raise "Failed to calculate the score (##{thr.value}): #{buffer}" unless thr.value.to_i.zero? break end - sleep(10) + sleep(1) Thread.current.thread_variable_set(:buffer, buffer.length.to_s) end after = Score.parse(buffer.strip) @log.debug("Next score #{after.value}/#{after.strength} found in proc ##{thr.pid} \ for #{after.host}:#{after.port} in #{Age.new(start)}: #{after.suffixes}")