lib/zold/commands/fetch.rb in zold-0.14.43 vs lib/zold/commands/fetch.rb in zold-0.14.44
- old
+ new
@@ -86,11 +86,11 @@
total.increment(fetch_one(id, r, cps, opts))
done.increment
end
raise "There are no remote nodes, run 'zold remote reset'" if nodes.value.zero?
raise "No nodes out of #{nodes.value} have the wallet #{id}" if done.value.zero? && !opts['quiet-if-absent']
- @log.info("#{done.value} copies of #{id} fetched in #{(Time.now - start).round}s with the total score of \
+ @log.info("#{done.value} copies of #{id} fetched in #{Age.new(start)} with the total score of \
#{total.value} from #{nodes.value} nodes")
@log.debug("#{cps.all.count} local copies:")
cps.all.each do |c|
wallet = Wallet.new(c[:path])
@log.debug(" #{c[:name]}: #{c[:score]} #{wallet.balance}/#{wallet.txns.count}t/\
@@ -128,10 +128,10 @@
raise "The balance of #{id} is #{wallet.balance} and it's not a root wallet"
end
copy = cps.add(File.read(f), score.host, score.port, score.value)
@log.info("#{r} returned #{body.length}b/#{wallet.balance}/#{wallet.txns.count}t/\
#{digest(json)}/#{Age.new(json['mtime'])}/#{json['copies']}c \
-as copy #{copy} of #{id} in #{(Time.now - start).round(2)}s: #{Rainbow(score.value).green} (#{json['version']})")
+as copy #{copy} of #{id} in #{Age.new(start)}: #{Rainbow(score.value).green} (#{json['version']})")
end
score.value
end
def digest(json)