From 347b2a6a4cc413f13a63cda8bceb172c3be13f58 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 2 Jan 2025 17:32:27 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=9B=86=E7=BE=A4-=E8=87=AA=E5=8A=A8=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E8=BF=87=E5=9B=BD=E6=A0=87=E7=BA=A7=E8=81=94]=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/gb28181/service/impl/PlatformServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java index 94561f05..ec931b64 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java @@ -117,10 +117,16 @@ public class PlatformServiceImpl implements IPlatformService { return; } serverIds.forEach(serverId -> { - log.info("[集群] 检测到 {} 已离线", serverId); // 检查每个是否存活 ServerInfo serverInfo = redisCatchStorage.queryServerInfo(serverId); - if (serverInfo == null && userSetting.getServerId().equals(redisCatchStorage.chooseOneServer(serverId))) { + if (serverInfo != null) { + return; + }else { + log.info("[集群] 检测到 {} 已离线", serverId); + String chooseServerId = redisCatchStorage.chooseOneServer(serverId); + if (!userSetting.getServerId().equals(chooseServerId)){ + return; + } // 此平台需要选择新平台处理, 确定由当前平台即开始处理 List platformList = platformMapper.queryByServerId(serverId); platformList.forEach(platform -> {