Skip to content

Commit

Permalink
dashboard: Fix the bug that removing token servers may fail when ther…
Browse files Browse the repository at this point in the history
…e are servers with the same IP (#2591)
  • Loading branch information
icodening authored Mar 15, 2022
1 parent 0cd0629 commit 42878a2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ public static List<ClusterGroupEntity> wrapToClusterGroup(List<ClusterUniversalS
if (mode == ClusterStateManager.CLUSTER_SERVER) {
String serverAddress = getIp(ip);
int port = stateVO.getState().getServer().getPort();
map.computeIfAbsent(serverAddress, v -> new ClusterGroupEntity()
String targetAddress = serverAddress + ":" + port;
map.computeIfAbsent(targetAddress, v -> new ClusterGroupEntity()
.setBelongToApp(true).setMachineId(ip + '@' + stateVO.getCommandPort())
.setIp(ip).setPort(port)
);
Expand All @@ -145,8 +146,8 @@ public static List<ClusterGroupEntity> wrapToClusterGroup(List<ClusterUniversalS
if (StringUtil.isBlank(targetServer) || targetPort == null || targetPort <= 0) {
continue;
}

ClusterGroupEntity group = map.computeIfAbsent(targetServer,
String targetAddress = targetServer + ":" + targetPort;
ClusterGroupEntity group = map.computeIfAbsent(targetAddress,
v -> new ClusterGroupEntity()
.setBelongToApp(true).setMachineId(targetServer)
.setIp(targetServer).setPort(targetPort)
Expand Down

0 comments on commit 42878a2

Please sign in to comment.