From 9d37b411ec6f0eea32b7d659d62f31bee4d93dbb Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期日, 06 三月 2022 00:09:34 +0800 Subject: [PATCH] Merge pull request #375 from MeBetterMan/wvp-28181-2.0 --- src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java | 19 ++++++------------- 1 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java index 3fc6a3c..042b2d1 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson.JSONObject; import com.genersoft.iot.vmp.common.VideoManagerConstants; +import com.genersoft.iot.vmp.conf.RedisKeyExpirationEventMessageListener; import com.genersoft.iot.vmp.conf.UserSetup; import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; @@ -21,7 +22,7 @@ * @date: 2020骞�5鏈�6鏃� 涓婂崍11:35:46 */ @Component -public class ZLMKeepliveTimeoutListener extends KeyExpirationEventMessageListener { +public class ZLMKeepliveTimeoutListener extends RedisKeyExpirationEventMessageListener { private Logger logger = LoggerFactory.getLogger(ZLMKeepliveTimeoutListener.class); @@ -37,20 +38,12 @@ @Autowired private IMediaServerService mediaServerService; - @Override - public void init() { - if (!userSetup.getRedisConfig()) { - // 閰嶇疆springboot榛樿Config涓虹┖锛屽嵆涓嶈搴旂敤鍘讳慨鏀箁edis鐨勯粯璁ら厤缃紝鍥犱负Redis鏈嶅姟鍑轰簬瀹夊叏浼氱鐢–ONFIG鍛戒护缁欒繙绋嬬敤鎴蜂娇鐢� - setKeyspaceNotificationsConfigParameter(""); - } - super.init(); + public ZLMKeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer, UserSetup userSetup) { + super(listenerContainer, userSetup); } - public ZLMKeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) { - super(listenerContainer); - } - /** + /** * 鐩戝惉澶辨晥鐨刱ey锛宬ey鏍煎紡涓簁eeplive_deviceId * @param message * @param pattern @@ -72,7 +65,7 @@ if (mediaServerConfig == null) { publisher.zlmOfflineEventPublish(mediaServerId); }else { - logger.info("[zlm蹇冭烦鍒版湡]锛歿}楠岃瘉鍚巣lm浠嶅湪绾匡紝鍥炲蹇冭烦淇℃伅", mediaServerId); + logger.info("[zlm蹇冭烦鍒版湡]锛歿}楠岃瘉鍚巣lm浠嶅湪绾匡紝鎭㈠蹇冭烦淇℃伅", mediaServerId); // 娣诲姞zlm淇℃伅 mediaServerService.updateMediaServerKeepalive(mediaServerId, mediaServerConfig); } -- Gitblit v1.8.0