修复定时删除过期录像文件时,收藏文件被删除的问题
parent
c1bc45fe8f
commit
c98ef23b98
|
@ -41,8 +41,8 @@ public class CloudRecordTimer {
|
||||||
/**
|
/**
|
||||||
* 定时查询待删除的录像文件
|
* 定时查询待删除的录像文件
|
||||||
*/
|
*/
|
||||||
// @Scheduled(fixedRate = 5000) //每五秒执行一次,方便测试
|
@Scheduled(fixedRate = 5000) //每五秒执行一次,方便测试
|
||||||
@Scheduled(cron = "0 0 0 * * ?") //每天的0点执行
|
// @Scheduled(cron = "0 0 0 * * ?") //每天的0点执行
|
||||||
public void execute(){
|
public void execute(){
|
||||||
logger.info("[录像文件定时清理] 开始清理过期录像文件");
|
logger.info("[录像文件定时清理] 开始清理过期录像文件");
|
||||||
// 获取配置了assist的流媒体节点
|
// 获取配置了assist的流媒体节点
|
||||||
|
@ -56,7 +56,7 @@ public class CloudRecordTimer {
|
||||||
Calendar lastCalendar = Calendar.getInstance();
|
Calendar lastCalendar = Calendar.getInstance();
|
||||||
if (mediaServerItem.getRecordDay() > 0) {
|
if (mediaServerItem.getRecordDay() > 0) {
|
||||||
lastCalendar.setTime(new Date());
|
lastCalendar.setTime(new Date());
|
||||||
// 获取保存的最后截至日期,因为每个节点都有一个日期,也就是支持每个节点设置不同的保存日期,
|
// 获取保存的最后截至日[期,因为每个节点都有一个日期,也就是支持每个节点设置不同的保存日期,
|
||||||
lastCalendar.add(Calendar.DAY_OF_MONTH, -mediaServerItem.getRecordDay());
|
lastCalendar.add(Calendar.DAY_OF_MONTH, -mediaServerItem.getRecordDay());
|
||||||
Long lastDate = lastCalendar.getTimeInMillis();
|
Long lastDate = lastCalendar.getTimeInMillis();
|
||||||
|
|
||||||
|
|
|
@ -133,6 +133,9 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
JSONArray dataArray = jsonObject.getJSONArray("data");
|
JSONArray dataArray = jsonObject.getJSONArray("data");
|
||||||
JSONObject mediaServerConfig = dataArray.getJSONObject(0);
|
JSONObject mediaServerConfig = dataArray.getJSONObject(0);
|
||||||
String ffmpegCmd = mediaServerConfig.getString(param.getFfmpegCmdKey());
|
String ffmpegCmd = mediaServerConfig.getString(param.getFfmpegCmdKey());
|
||||||
|
if (ffmpegCmd == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "ffmpeg拉流代理无法获取ffmpeg cmd");
|
||||||
|
}
|
||||||
String schema = getSchemaFromFFmpegCmd(ffmpegCmd);
|
String schema = getSchemaFromFFmpegCmd(ffmpegCmd);
|
||||||
if (schema == null) {
|
if (schema == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "ffmpeg拉流代理无法从ffmpeg cmd中获取到输出格式");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "ffmpeg拉流代理无法从ffmpeg cmd中获取到输出格式");
|
||||||
|
|
|
@ -91,7 +91,7 @@ public interface CloudRecordServiceMapper {
|
||||||
@Select(" <script>" +
|
@Select(" <script>" +
|
||||||
"select *" +
|
"select *" +
|
||||||
" from wvp_cloud_record " +
|
" from wvp_cloud_record " +
|
||||||
" where end_time <= #{endTimeStamp} and media_server_id = #{mediaServerId} " +
|
" where collect = false and end_time <= #{endTimeStamp} and media_server_id = #{mediaServerId} " +
|
||||||
" </script>")
|
" </script>")
|
||||||
List<CloudRecordItem> queryRecordListForDelete(@Param("endTimeStamp")Long endTimeStamp, String mediaServerId);
|
List<CloudRecordItem> queryRecordListForDelete(@Param("endTimeStamp")Long endTimeStamp, String mediaServerId);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue