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