diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb index e205703c6..7456570ce 100644 --- a/lib/oxidized/nodes.rb +++ b/lib/oxidized/nodes.rb @@ -69,7 +69,7 @@ def fetch(node_name, group) # @param node [String] name of the node moved into the head of array def next(node, opt = {}) - return unless waiting.find_node_index(node) + return if running.find_index(node) with_lock do n = del node @@ -116,6 +116,10 @@ def get_diff(node_name, group, oid1, oid2) end end + def find_index(node) + index { |e| [e.name, e.ip].include? node } + end + private def initialize(opts = {}) @@ -133,10 +137,6 @@ def with_lock(...) @mutex.synchronize(...) end - def find_index(node) - index { |e| [e.name, e.ip].include? node } - end - # @param node node which is removed from nodes list # @return [Node] deleted node def del(node)