From 7dea67b4723ff377c7132c00a270d0986ac479e3 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Tue, 27 Jan 2026 21:08:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BF=83=E8=B7=B3=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E6=96=B0=E5=A2=9Ecommons-p?= =?UTF-8?q?ool2=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 5 +++++ .../message/notify/cmd/KeepaliveNotifyMessageHandler.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2da8a723..8b072c6e5 100644 --- a/pom.xml +++ b/pom.xml @@ -406,6 +406,11 @@ 1.18.2 + + org.apache.commons + commons-pool2 + + org.springframework.boot spring-boot-starter-test diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java index 25fb845f1..7e2b0794b 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java @@ -69,6 +69,7 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp } catch (SipException | InvalidArgumentException | ParseException e) { log.error("[命令发送失败] 心跳回复: {}", e.getMessage()); } + taskQueue.add(device); SIPRequest request = (SIPRequest) evt.getRequest(); RemoteAddressInfo remoteAddressInfo = SipUtils.getRemoteAddressFromRequest(request, userSetting.getSipUseSourceIpAsRemoteAddress()); @@ -80,7 +81,7 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp device.setLocalIp(request.getLocalAddress().getHostAddress()); } device.setKeepaliveTimeStamp(System.currentTimeMillis()); - taskQueue.add(device); + if (device.isOnLine()) { long expiresTime = Math.min(device.getExpires(), device.getHeartBeatInterval() * device.getHeartBeatCount()) * 1000L; deviceStatusManager.add(device.getDeviceId(), expiresTime + System.currentTimeMillis());