From ffb21248cb270475ce9156b5056e591e14cbc20d Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 30 五月 2023 11:20:22 +0800
Subject: [PATCH] 去除多余配置
---
src/main/java/com/genersoft/iot/vmp/media/zlm/ZlmHttpHookSubscribe.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 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 823bdab..8f6a3fa 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
@@ -1,6 +1,6 @@
package com.genersoft.iot.vmp.media.zlm;
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.media.zlm.dto.HookType;
import com.genersoft.iot.vmp.media.zlm.dto.IHookSubscribe;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
@@ -98,7 +98,10 @@
if (!CollectionUtils.isEmpty(entriesToRemove)) {
for (Map.Entry<IHookSubscribe, ZlmHttpHookSubscribe.Event> entry : entriesToRemove) {
- entries.remove(entry);
+ eventMap.remove(entry.getKey());
+ }
+ if (eventMap.size() == 0) {
+ allSubscribes.remove(hookSubscribe.getHookType());
}
}
@@ -134,11 +137,9 @@
/**
* 瀵硅闃呮暟鎹繘琛岃繃鏈熸竻鐞�
*/
- @Scheduled(cron="0 0/5 * * * ?") //姣�5鍒嗛挓鎵ц涓�娆�
+// @Scheduled(cron="0 0/5 * * * ?") //姣�5鍒嗛挓鎵ц涓�娆�
+ @Scheduled(fixedRate = 2 * 1000)
public void execute(){
-
- logger.info("[hook璁㈤槄] 娓呯悊");
-
Instant instant = Instant.now().minusMillis(TimeUnit.MINUTES.toMillis(5));
int total = 0;
for (HookType hookType : allSubscribes.keySet()) {
@@ -153,6 +154,5 @@
}
}
}
- logger.info("[hook璁㈤槄] 娓呯悊缁撴潫锛屽叡娓呯悊{}鏉¤繃鏈熸暟鎹�", total);
}
}
--
Gitblit v1.8.0