lib/zold/commands/remote.rb in zold-0.17.10 vs lib/zold/commands/remote.rb in zold-0.18.0

- old
+ new

@@ -225,11 +225,11 @@ end scores = scores.sample(opts['max-winners']) if scores.empty? @log.info("No winners elected out of #{@remotes.all.count} remotes") else - scores.each { |s| @log.info("Elected: #{s}") } + scores.each { |s| @log.info("Elected: #{s.reduced(4)}") } end scores end def trim(opts) @@ -293,10 +293,12 @@ def select(opts) selected = @remotes.all.sort_by { |r| r[:score] }.reverse.first(opts['max-nodes']) (@remotes.all - selected).each do |r| @remotes.remove(r[:host], r[:port]) + @log.info("Remote #{r[:host]}:#{r[:port]}/#{r[:score]} removed from the list, #{@remotes.all.count} left") end + @log.info("#{opts['max-nodes']} remote nodes left in the list") end def terminate @log.info("All threads before exit: #{Thread.list.map { |t| "#{t.name}/#{t.status}" }.join(', ')}") require_relative '../node/front'