Navigation Menu

Skip to content

Commit

Permalink
Output stable results for status of nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 8, 2015
1 parent 8b61c62 commit 9eb1c5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/droonga/cluster.rb
Expand Up @@ -134,7 +134,11 @@ def engine_nodes_status
"status" => node.status,
}
end
nodes_status
sorted_nodes_status = {}
nodes_status.keys.sort.each do |key|
sorted_nodes_status[key] = nodes_status[key]
end
sorted_nodes_status
end

def forward(message, destination)
Expand Down
6 changes: 5 additions & 1 deletion lib/droonga/serf.rb
Expand Up @@ -150,7 +150,11 @@ def current_cluster_state(options={})
unprocessed_messages_existence.each do |node_name, have_messages|
nodes[node_name]["have_unprocessed_messages"] = have_messages
end
nodes
sorted_nodes = {}
nodes.keys.sort.each do |key|
sorted_nodes[key] = nodes[key]
end
sorted_nodes
end

def set_tag(name, value)
Expand Down

0 comments on commit 9eb1c5a

Please sign in to comment.