From f10b458fc919fbcadc4936bf3a7886088e20ac71 Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: 星期五, 08 四月 2022 14:44:49 +0800 Subject: [PATCH] 优化订阅信息的发送与取消订阅 --- src/main/java/com/genersoft/iot/vmp/conf/runner/SipDeviceRunner.java | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/runner/SipDeviceRunner.java b/src/main/java/com/genersoft/iot/vmp/conf/runner/SipDeviceRunner.java index 2c2ea6d..4a89796 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/runner/SipDeviceRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/runner/SipDeviceRunner.java @@ -14,7 +14,7 @@ /** - * 绯荤粺鍚姩鏃舵帶鍒惰澶囩绾� + * 绯荤粺鍚姩鏃舵帶鍒惰澶� */ @Component @Order(value=4) @@ -41,10 +41,14 @@ for (String deviceId : onlineForAll) { storager.online(deviceId); Device device = redisCatchStorage.getDevice(deviceId); - if (device != null && device.getSubscribeCycleForCatalog() > 0) { - // 鏌ヨ鍦ㄧ嚎璁惧閭d簺寮�鍚簡璁㈤槄锛屼负璁惧寮�鍚畾鏃剁殑鐩綍璁㈤槄 - deviceService.addCatalogSubscribe(device); - deviceService.addMobilePositionSubscribe(device); + if (device != null ) { + if (device.getSubscribeCycleForCatalog() > 0) { + // 鏌ヨ鍦ㄧ嚎璁惧閭d簺寮�鍚簡璁㈤槄锛屼负璁惧寮�鍚畾鏃剁殑鐩綍璁㈤槄 + deviceService.addCatalogSubscribe(device); + } + if (device.getSubscribeCycleForMobilePosition() > 0) { + deviceService.addMobilePositionSubscribe(device); + } } } // 閲嶇疆cseq璁℃暟 -- Gitblit v1.8.0