From 03033e6ac984e1d6a425022d7bfb8f0a6b2e283a Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 18 Dec 2024 11:30:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/NotifyRequestForMobilePositionProcessor.java | 4 +++- .../iot/vmp/service/impl/MobilePositionServiceImpl.java | 8 +------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java index ed367876..9d8895e8 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java @@ -199,7 +199,9 @@ public class NotifyRequestForMobilePositionProcessor extends SIPRequestProcessor } } } catch (DocumentException e) { - log.error("未处理的异常 ", e); + log.error("[收到移动位置订阅通知] 文档解析异常: \r\n{}", evt.getRequest(), e); + } catch ( Exception e) { + log.error("[收到移动位置订阅通知] 异常: ", e); } } } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MobilePositionServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MobilePositionServiceImpl.java index 0241f69a..1f20ffa1 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MobilePositionServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MobilePositionServiceImpl.java @@ -61,13 +61,7 @@ public class MobilePositionServiceImpl implements IMobilePositionService { if (size == null || size == 0) { return new ArrayList<>(); } - List mobilePositions; - if (size > length) { - mobilePositions = redisTemplate.opsForList().rightPop(REDIS_MOBILE_POSITION_LIST, length); - }else { - mobilePositions = redisTemplate.opsForList().rightPop(REDIS_MOBILE_POSITION_LIST, size); - } - return mobilePositions; + return redisTemplate.opsForList().rightPop(REDIS_MOBILE_POSITION_LIST, Math.min(length, size)); }