[集群-自动切换过国标级联] 修复BUG

This commit is contained in:
648540858
2025-01-02 17:26:50 +08:00
parent ea2ef923ac
commit 0566bf916f
4 changed files with 6 additions and 4 deletions

View File

@@ -120,13 +120,14 @@ public class PlatformServiceImpl implements IPlatformService {
log.info("[集群] 检测到 {} 已离线", serverId);
// 检查每个是否存活
ServerInfo serverInfo = redisCatchStorage.queryServerInfo(serverId);
if (serverInfo == null && userSetting.getServerId().equals(redisCatchStorage.chooseOneServer())) {
if (serverInfo == null && userSetting.getServerId().equals(redisCatchStorage.chooseOneServer(serverId))) {
// 此平台需要选择新平台处理, 确定由当前平台即开始处理
List<Platform> platformList = platformMapper.queryByServerId(serverId);
platformList.forEach(platform -> {
log.info("[集群] 由本平台开启上级平台{}({})的注册", platform.getName(), platform.getServerGBId());
// 设置平台使用当前平台的IP
platform.setAddress(getIpWithSameNetwork(platform.getAddress()));
platform.setServerId(userSetting.getServerId());
platformMapper.update(platform);
// 更新redis
redisCatchStorage.delPlatformCatchInfo(platform.getServerGBId());