From ec79694bb66ba1ea2197fe47e6d19ed67eafd63d Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Thu, 22 Feb 2024 10:00:27 +0800 Subject: [PATCH] =?UTF-8?q?liveCacheKey=20=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mocking/service/device/DeviceProxyService.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java index 919d643..6a7177b 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java @@ -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> retryer = RetryerBuilder.>newBuilder()