From ffc8a530f30ba5d200dc885aef7404c5cbab282e Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 24 Nov 2023 10:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/genersoft/iot/vmp/conf/CloudRecordTimer.java | 7 +++---- src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java | 4 ++-- .../iot/vmp/storager/dao/CloudRecordServiceMapper.java | 2 +- src/main/resources/all-application.yml | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/CloudRecordTimer.java b/src/main/java/com/genersoft/iot/vmp/conf/CloudRecordTimer.java index 111077b5..89f16cb0 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/CloudRecordTimer.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/CloudRecordTimer.java @@ -41,12 +41,12 @@ public class CloudRecordTimer { /** * 定时查询待删除的录像文件 */ -// @Scheduled(fixedRate = 5000) //每五秒执行一次,方便测试 +// @Scheduled(fixedRate = 10000) //每五秒执行一次,方便测试 @Scheduled(cron = "0 0 0 * * ?") //每天的0点执行 public void execute(){ logger.info("[录像文件定时清理] 开始清理过期录像文件"); // 获取配置了assist的流媒体节点 - List mediaServerItemList = mediaServerService.getAllWithAssistPort(); + List mediaServerItemList = mediaServerService.getAllOnline(); if (mediaServerItemList.isEmpty()) { return; } @@ -70,8 +70,7 @@ public class CloudRecordTimer { String date = new File(cloudRecordItem.getFilePath()).getParentFile().getName(); JSONObject jsonObject = zlmresTfulUtils.deleteRecordDirectory(mediaServerItem, cloudRecordItem.getApp(), cloudRecordItem.getStream(), date, cloudRecordItem.getFileName()); - if (jsonObject.getInteger("code") == 0) { - }else { + if (jsonObject.getInteger("code") != 0) { logger.warn("[录像文件定时清理] 删除磁盘文件错误: {}:{}", cloudRecordItem.getFilePath(), jsonObject); } } diff --git a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java index 3acc795e..96f3dfd9 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java @@ -81,8 +81,8 @@ public class MediaConfig{ @Value("${media.record-assist-port:0}") private Integer recordAssistPort = 0; - @Value("${media.record-date:7}") - private Integer recordDay = 7; + @Value("${media.record-day:7}") + private Integer recordDay; @Value("${media.record-path}") private String recordPath; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java index 46166780..d51f3f91 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java @@ -101,7 +101,7 @@ public interface CloudRecordServiceMapper { int changeCollectById(@Param("collect") boolean collect, @Param("recordId") Integer recordId); @Delete(" ") int deleteList(List cloudRecordItemIdList); diff --git a/src/main/resources/all-application.yml b/src/main/resources/all-application.yml index 6a075140..f5c9d63b 100644 --- a/src/main/resources/all-application.yml +++ b/src/main/resources/all-application.yml @@ -155,7 +155,7 @@ media: # 录像路径 record-path: ./www/record # 录像保存时长 - record-date: 7 + record-day: 7 # 启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试 rtp: # [可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输