Code snippet optimization
This commit is contained in:
@@ -63,8 +63,8 @@ public class NetworkUtils {
|
||||
}
|
||||
|
||||
public static Set<String> getServerIps() {
|
||||
try {
|
||||
if (serverIps.isEmpty()) {
|
||||
if (serverIps.isEmpty()) {
|
||||
try {
|
||||
String ip = System.getProperty(SERVER_IP);
|
||||
if (StringUtils.isBlank(ip)) {
|
||||
ip = System.getenv(SERVER_IP);
|
||||
@@ -91,11 +91,11 @@ public class NetworkUtils {
|
||||
serverIps.add(ip);
|
||||
}
|
||||
log.info("server ip: {}", serverIps);
|
||||
} catch (SocketException | UnknownHostException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return serverIps;
|
||||
} catch (SocketException | UnknownHostException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return serverIps;
|
||||
}
|
||||
|
||||
public static int getServerId() {
|
||||
|
||||
Reference in New Issue
Block a user