Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #3163 #3250

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/oxidized/nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {})
Expand All @@ -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)
Expand Down
Loading