liveCacheKey 判空

This commit is contained in:
shikong 2024-02-22 10:00:27 +08:00
parent 2704f224b8
commit ec79694bb6

View File

@ -416,11 +416,15 @@ public class DeviceProxyService {
@SneakyThrows
public void pullLiveStream2Rtp(SIPRequest request,Runnable sendOkResponse,String callId, MockingDevice device, String rtpAddr, int rtpPort, String ssrc){
String liveCacheKey = CacheUtil.getKey("INVITE", "LIVE", device.getGbDeviceId());
String liveCache = RedisUtil.StringOps.get(liveCacheKey);
RedisUtil.KeyOps.delete(liveCache);
// 关闭已存在的实时流 bye 订阅如果存在
subscribe.getByeSubscribe().delPublisher(liveCache);
String liveCache;
if(liveCacheKey != null){
liveCache = RedisUtil.StringOps.get(liveCacheKey);
if(liveCache != null){
RedisUtil.KeyOps.delete(liveCache);
// 关闭已存在的实时流 bye 订阅如果存在
subscribe.getByeSubscribe().delPublisher(liveCache);
}
}
ScheduledFuture<?> schedule = trying(request);
Retryer<ZlmResponse<AddStreamProxyResp>> retryer = RetryerBuilder.<ZlmResponse<AddStreamProxyResp>>newBuilder()