From e344445ed93d95a83161dc0f0faf96e75160e7f6 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 8 May 2023 17:55:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhook=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/media/zlm/ZlmHttpHookSubscribe.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZlmHttpHookSubscribe.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZlmHttpHookSubscribe.java index 4d0069b1..8f6a3faf 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZlmHttpHookSubscribe.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZlmHttpHookSubscribe.java @@ -98,7 +98,10 @@ public class ZlmHttpHookSubscribe { if (!CollectionUtils.isEmpty(entriesToRemove)) { for (Map.Entry entry : entriesToRemove) { - entries.remove(entry); + eventMap.remove(entry.getKey()); + } + if (eventMap.size() == 0) { + allSubscribes.remove(hookSubscribe.getHookType()); } } @@ -137,7 +140,6 @@ public class ZlmHttpHookSubscribe { // @Scheduled(cron="0 0/5 * * * ?") //每5分钟执行一次 @Scheduled(fixedRate = 2 * 1000) public void execute(){ - System.out.println(allSubscribes.size()); Instant instant = Instant.now().minusMillis(TimeUnit.MINUTES.toMillis(5)); int total = 0; for (HookType hookType : allSubscribes.keySet()) {