From c5a05c15df6c01602f259a49ff470fa996579b0b Mon Sep 17 00:00:00 2001 From: lawrencehj <1934378145@qq.com> Date: Fri, 26 Mar 2021 19:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E5=85=88=E5=89=8D=E6=B3=A8=E5=86=8C=E4=B8=8A=E7=BA=A7=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=9A=84=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/conf/SipPlatformRunner.java | 3 +++ .../genersoft/iot/vmp/storager/IRedisCatchStorage.java | 2 ++ .../iot/vmp/storager/impl/RedisCatchStorageImpl.java | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java b/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java index dd7c7a0c..35862078 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java @@ -33,6 +33,9 @@ public class SipPlatformRunner implements CommandLineRunner { // 设置所有平台离线 storager.outlineForAllParentPlatform(); + // 清理所有平台注册缓存 + redisCatchStorage.cleanPlatformRegisterInfos(); + List parentPlatforms = storager.queryEnableParentPlatformList(true); for (ParentPlatform parentPlatform : parentPlatforms) { diff --git a/src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java b/src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java index c9f5fff8..2866611f 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/IRedisCatchStorage.java @@ -81,6 +81,8 @@ public interface IRedisCatchStorage { void delPlatformRegisterInfo(String callId); + void cleanPlatformRegisterInfos(); + void updateSendRTPSever(SendRtpItem sendRtpItem); /** diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java index c5e31d62..98710833 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Component; import java.util.*; +@SuppressWarnings("rawtypes") @Component public class RedisCatchStorageImpl implements IRedisCatchStorage { @@ -212,6 +213,14 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { redis.del(VideoManagerConstants.PLATFORM_REGISTER_INFO_PREFIX + callId); } + @Override + public void cleanPlatformRegisterInfos() { + List regInfos = redis.scan(VideoManagerConstants.PLATFORM_REGISTER_INFO_PREFIX + "*"); + for (Object key : regInfos) { + redis.del(key.toString()); + } + } + @Override public void updateSendRTPSever(SendRtpItem sendRtpItem) { String key = VideoManagerConstants.PLATFORM_SEND_RTP_INFO_PREFIX + sendRtpItem.getPlatformId() + "_" + sendRtpItem.getChannelId();