From c98ef23b98573d622f6637bb181bfebc8172b118 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 21 Nov 2023 14:30:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=BF=87=E6=9C=9F=E5=BD=95=E5=83=8F=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=94=B6=E8=97=8F=E6=96=87=E4=BB=B6=E8=A2=AB?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/genersoft/iot/vmp/conf/CloudRecordTimer.java | 6 +++--- .../iot/vmp/service/impl/StreamProxyServiceImpl.java | 3 +++ .../iot/vmp/storager/dao/CloudRecordServiceMapper.java | 2 +- 3 files changed, 7 insertions(+), 4 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 a58fe6de..78272c92 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/CloudRecordTimer.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/CloudRecordTimer.java @@ -41,8 +41,8 @@ public class CloudRecordTimer { /** * 定时查询待删除的录像文件 */ -// @Scheduled(fixedRate = 5000) //每五秒执行一次,方便测试 - @Scheduled(cron = "0 0 0 * * ?") //每天的0点执行 + @Scheduled(fixedRate = 5000) //每五秒执行一次,方便测试 +// @Scheduled(cron = "0 0 0 * * ?") //每天的0点执行 public void execute(){ logger.info("[录像文件定时清理] 开始清理过期录像文件"); // 获取配置了assist的流媒体节点 @@ -56,7 +56,7 @@ public class CloudRecordTimer { Calendar lastCalendar = Calendar.getInstance(); if (mediaServerItem.getRecordDay() > 0) { lastCalendar.setTime(new Date()); - // 获取保存的最后截至日期,因为每个节点都有一个日期,也就是支持每个节点设置不同的保存日期, + // 获取保存的最后截至日[期,因为每个节点都有一个日期,也就是支持每个节点设置不同的保存日期, lastCalendar.add(Calendar.DAY_OF_MONTH, -mediaServerItem.getRecordDay()); Long lastDate = lastCalendar.getTimeInMillis(); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java index eac543a3..bb6e3b03 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java @@ -133,6 +133,9 @@ public class StreamProxyServiceImpl implements IStreamProxyService { JSONArray dataArray = jsonObject.getJSONArray("data"); JSONObject mediaServerConfig = dataArray.getJSONObject(0); String ffmpegCmd = mediaServerConfig.getString(param.getFfmpegCmdKey()); + if (ffmpegCmd == null) { + throw new ControllerException(ErrorCode.ERROR100.getCode(), "ffmpeg拉流代理无法获取ffmpeg cmd"); + } String schema = getSchemaFromFFmpegCmd(ffmpegCmd); if (schema == null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "ffmpeg拉流代理无法从ffmpeg cmd中获取到输出格式"); 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 594bceef..46166780 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 @@ -91,7 +91,7 @@ public interface CloudRecordServiceMapper { @Select(" ") List queryRecordListForDelete(@Param("endTimeStamp")Long endTimeStamp, String mediaServerId);