module Aerospike::Node::Refresh::Racks

Public Class Methods

call(node) click to toggle source
# File lib/aerospike/node/refresh/racks.rb, line 25
def call(node)
  return unless should_refresh?(node)

  Aerospike.logger.info("Updating racks for node #{node.name}")
  conn = node.tend_connection
  parser = RackParser.new(node, conn)
  node.update_racks(parser)
rescue ::Aerospike::Exceptions::Aerospike => e
  conn.close
  Refresh::Failed.(node, e)
end
should_refresh?(node) click to toggle source

Do not refresh racks when node connection has already failed during this cluster tend iteration.

# File lib/aerospike/node/refresh/racks.rb, line 39
def should_refresh?(node)
  return false if node.failed? || !node.active?
  true
end