V3 modify revert
This commit is contained in:
parent
ab36a1bb83
commit
b7790c5a87
|
|
@ -200,15 +200,7 @@ public class MongoDBMethodInterceptor implements InstanceMethodsAroundIntercepto
|
|||
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
|
||||
Cluster cluster = (Cluster)allArguments[0];
|
||||
StringBuilder peers = new StringBuilder();
|
||||
List<ServerDescription> servers;
|
||||
try {
|
||||
cluster.getDescription().getClass().getMethod("getServerDescriptions", null);
|
||||
servers = cluster.getDescription().getServerDescriptions();
|
||||
|
||||
} catch (NoSuchMethodException e) {
|
||||
servers = cluster.getDescription().getAny();
|
||||
}
|
||||
for (ServerDescription description : servers) {
|
||||
for (ServerDescription description : cluster.getDescription().getServerDescriptions()) {
|
||||
ServerAddress address = description.getAddress();
|
||||
peers.append(address.getHost() + ":" + address.getPort() + ";");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue