do not try to connect if not a part of cluster

This commit is contained in:
Svyatoslav Nikolsky 2017-07-21 10:49:10 +03:00
parent c94c799347
commit 023e5b4b90

View File

@ -751,7 +751,11 @@ impl ClusterConnections {
pub fn update_nodes_set(&self) { pub fn update_nodes_set(&self) {
let mut data = self.data.write(); let mut data = self.data.write();
let mut new_nodes = self.key_server_set.get(); let mut new_nodes = self.key_server_set.get();
new_nodes.remove(&self.self_node_id); // we do not need to connect to self
// + we do not need to try to connect to any other node if we are not the part of a cluster
if new_nodes.remove(&self.self_node_id).is_none() {
new_nodes.clear();
}
let mut num_added_nodes = 0; let mut num_added_nodes = 0;
let mut num_removed_nodes = 0; let mut num_removed_nodes = 0;