lib/zold/remotes.rb
# The default TCP port all nodes are supposed to use.
The default TCP port all nodes are supposed to use.
The default TCP port all nodes are supposed to use .
def iterate(log, farm: Farm::Empty.new)
      raise 'Log can\'t be nil' if log.nil?
      raise 'Farm can\'t be nil' if farm.nil?
      best = farm.best[0]
      require_relative 'score'
      score = best.nil? ? Score::ZERO : best
      idx = 0
      all.each do |r|
        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
        rescue StandardError => e
          error(r[:host], r[:port])
          errors = errors(r[:host], r[:port])
          log.info("#{Rainbow("#{r[:host]}:#{r[:port]}").red}: #{e.message} \
in #{(Time.now - start).round}s; errors=#{errors}")
          log.debug(Backtrace.new(e).to_s)
          remove(r[:host], r[:port]) if errors > Remotes::TOLERANCE
        end
      end
    end
def iterate ( log , farm : Farm :: Empty . new ) raise 'Log can\'t be nil' if log . nil? raise 'Farm can\'t be nil' if farm . nil? best = farm . best [ 0 ] require_relative 'score' score = best . nil? ? Score :: ZERO : best idx = 0 all . each do | r | 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 rescue StandardError => e error ( r [ :host ] , r [ :port ] ) errors = errors ( r [ :host ] , r [ :port ] ) log . info ( "#{Rainbow("#{r[:host]}:#{r[:port]}").red}: #{e.message} \
in #{(Time.now - start).round}s; errors=#{errors}" ) log . debug ( Backtrace . new ( e ) . to_s ) remove ( r [ :host ] , r [ :port ] ) if errors > Remotes :: TOLERANCE end end end
The default TCP port all nodes are supposed to use.
The default TCP port all nodes are supposed to use .
log
<not_specific>
farm
<not_specific>
new
<not_specific>