Commit ea601575 authored by Jason Song's avatar Jason Song Committed by GitHub

fix the performance issue when calling getHostName (#2152)

parent 11640388
...@@ -42,11 +42,16 @@ public enum NetworkInterfaceManager { ...@@ -42,11 +42,16 @@ public enum NetworkInterfaceManager {
weight += 2; weight += 2;
} }
/**
* The following logic is removed as we will sort the network interfaces according to the index asc to determine
* the priorities between network interfaces, see https://github.com/ctripcorp/apollo/pull/1986
*/
// has host name // has host name
// TODO fix performance issue when calling getHostName /*
if (!Objects.equals(address.getHostName(), address.getHostAddress())) { if (!Objects.equals(address.getHostName(), address.getHostAddress())) {
weight += 1; weight += 1;
} }
*/
if (weight > maxWeight) { if (weight > maxWeight) {
maxWeight = weight; maxWeight = weight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment