From f4c687b4030298a599881a1712c0ceda054d8719 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Tue, 6 Feb 2024 16:44:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=B9=E6=8D=AE=20?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E7=9A=84?= =?UTF-8?q?=20recordInfo=20=E6=9F=A5=E8=AF=A2,=20=E9=A2=84=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E8=A7=86=E9=A2=91=E6=96=87=E4=BB=B6=E5=88=B0=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=8C=87=E5=AE=9A=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mocking/core/sip/service/VideoCacheManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/service/VideoCacheManager.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/service/VideoCacheManager.java index 29d7037..b621578 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/service/VideoCacheManager.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/service/VideoCacheManager.java @@ -76,13 +76,13 @@ public class VideoCacheManager { @SneakyThrows protected CompletableFuture> downloadVideo(String deviceCode, Date startTime, Date endTime) { - return CompletableFuture.supplyAsync(()->{ - File realFile = Paths.get(deviceProxyConfig.getPreDownloadForRecordInfo().getCachePath(),fileName(deviceCode, startTime, endTime) + ".mp4").toFile(); - if(realFile.exists()){ - log.info("文件 {} 已缓存, 直接返回", realFile.getAbsolutePath()); - return JsonResponse.success(realFile.getAbsolutePath()); - } + File realFile = Paths.get(deviceProxyConfig.getPreDownloadForRecordInfo().getCachePath(),fileName(deviceCode, startTime, endTime) + ".mp4").toFile(); + if(realFile.exists()){ + log.info("文件 {} 已缓存, 直接返回", realFile.getAbsolutePath()); + return CompletableFuture.completedFuture(JsonResponse.success(realFile.getAbsolutePath())); + } + return CompletableFuture.supplyAsync(()->{ final String url = UrlBuilder.of(deviceProxyConfig.getUrl()) .addPath("video") .addQuery("device_id", deviceCode)