Fix isSelf address. (#3051)
This commit is contained in:
parent
deb2d90029
commit
52b674e3a5
|
|
@ -68,7 +68,11 @@ public class EtcdCoordinator implements ClusterRegister, ClusterNodesQuery {
|
|||
if (nodes != null) {
|
||||
nodes.forEach(node -> {
|
||||
EtcdEndpoint endpoint = gson.fromJson(node.getValue(), EtcdEndpoint.class);
|
||||
res.add(new RemoteInstance(new Address(endpoint.getHost(), endpoint.getPort(), true)));
|
||||
Address address = new Address(endpoint.getHost(), endpoint.getPort(), true);
|
||||
if (!address.equals(selfAddress)) {
|
||||
address.setSelf(false);
|
||||
}
|
||||
res.add(new RemoteInstance(address));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue