Method: Oxidized::Nodes#next

Defined in:
lib/oxidized/nodes.rb

#next(node, opt = {}) ⇒ Object Also known as: top

Parameters:

  • node (String)

    name of the node moved into the head of array



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oxidized/nodes.rb', line 68

def next(node, opt = {})
  return unless waiting.find_node_index(node)

  with_lock do
    n = del node
    n.user = opt['user']
    n.email = opt['email']
    n.msg  = opt['msg']
    n.from = opt['from']
    # set last job to nil so that the node is picked for immediate update
    n.last = nil
    put n
    jobs.want += 1 if Oxidized.config.next_adds_job?
  end
end