From 8bd2f47c9a92ffcf5ae43fae965eaefd4748e263 Mon Sep 17 00:00:00 2001 From: lishuyuan <lishuyuan@inspur.com> Date: 星期四, 02 十一月 2023 10:17:47 +0800 Subject: [PATCH] bugfix:目录订阅收到更新事件时,sql字段update_time为空导致的报错 --- src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java index d385d9a..d932a20 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java @@ -32,11 +32,13 @@ public void putCatalogSubscribe(String platformId, SubscribeInfo subscribeInfo) { catalogMap.put(platformId, subscribeInfo); - // 娣诲姞璁㈤槄鍒版湡 - String taskOverdueKey = taskOverduePrefix + "catalog_" + platformId; - // 娣诲姞浠诲姟澶勭悊璁㈤槄杩囨湡 - dynamicTask.startDelay(taskOverdueKey, () -> removeCatalogSubscribe(subscribeInfo.getId()), - subscribeInfo.getExpires() * 1000); + if (subscribeInfo.getExpires() > 0) { + // 娣诲姞璁㈤槄鍒版湡 + String taskOverdueKey = taskOverduePrefix + "catalog_" + platformId; + // 娣诲姞浠诲姟澶勭悊璁㈤槄杩囨湡 + dynamicTask.startDelay(taskOverdueKey, () -> removeCatalogSubscribe(subscribeInfo.getId()), + subscribeInfo.getExpires() * 1000); + } } public SubscribeInfo getCatalogSubscribe(String platformId) { @@ -63,11 +65,13 @@ dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(platformId), subscribeInfo.getGpsInterval() * 1000); String taskOverdueKey = taskOverduePrefix + "MobilePosition_" + platformId; - // 娣诲姞浠诲姟澶勭悊璁㈤槄杩囨湡 - dynamicTask.startDelay(taskOverdueKey, () -> { - removeMobilePositionSubscribe(subscribeInfo.getId()); - }, - subscribeInfo.getExpires() * 1000); + if (subscribeInfo.getExpires() > 0) { + // 娣诲姞浠诲姟澶勭悊璁㈤槄杩囨湡 + dynamicTask.startDelay(taskOverdueKey, () -> { + removeMobilePositionSubscribe(subscribeInfo.getId()); + }, + subscribeInfo.getExpires() * 1000); + } } public SubscribeInfo getMobilePositionSubscribe(String platformId) { -- Gitblit v1.8.0