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());