dashboard: Fix the bug that removing token servers may fail when there are servers with the same IP (#2591)
This commit is contained in:
parent
0cd06291f3
commit
42878a29e0
|
|
@ -130,7 +130,8 @@ public final class ClusterEntityUtils {
|
||||||
if (mode == ClusterStateManager.CLUSTER_SERVER) {
|
if (mode == ClusterStateManager.CLUSTER_SERVER) {
|
||||||
String serverAddress = getIp(ip);
|
String serverAddress = getIp(ip);
|
||||||
int port = stateVO.getState().getServer().getPort();
|
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())
|
.setBelongToApp(true).setMachineId(ip + '@' + stateVO.getCommandPort())
|
||||||
.setIp(ip).setPort(port)
|
.setIp(ip).setPort(port)
|
||||||
);
|
);
|
||||||
|
|
@ -145,8 +146,8 @@ public final class ClusterEntityUtils {
|
||||||
if (StringUtil.isBlank(targetServer) || targetPort == null || targetPort <= 0) {
|
if (StringUtil.isBlank(targetServer) || targetPort == null || targetPort <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
String targetAddress = targetServer + ":" + targetPort;
|
||||||
ClusterGroupEntity group = map.computeIfAbsent(targetServer,
|
ClusterGroupEntity group = map.computeIfAbsent(targetAddress,
|
||||||
v -> new ClusterGroupEntity()
|
v -> new ClusterGroupEntity()
|
||||||
.setBelongToApp(true).setMachineId(targetServer)
|
.setBelongToApp(true).setMachineId(targetServer)
|
||||||
.setIp(targetServer).setPort(targetPort)
|
.setIp(targetServer).setPort(targetPort)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue