启动时清除先前注册上级平台的缓存

This commit is contained in:
lawrencehj 2021-03-26 19:58:46 +08:00
parent 88dd1aca45
commit c5a05c15df
3 changed files with 14 additions and 0 deletions

View File

@ -33,6 +33,9 @@ public class SipPlatformRunner implements CommandLineRunner {
// 设置所有平台离线
storager.outlineForAllParentPlatform();
// 清理所有平台注册缓存
redisCatchStorage.cleanPlatformRegisterInfos();
List<ParentPlatform> parentPlatforms = storager.queryEnableParentPlatformList(true);
for (ParentPlatform parentPlatform : parentPlatforms) {

View File

@ -81,6 +81,8 @@ public interface IRedisCatchStorage {
void delPlatformRegisterInfo(String callId);
void cleanPlatformRegisterInfos();
void updateSendRTPSever(SendRtpItem sendRtpItem);
/**

View File

@ -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();