From c36649580558e0bdd2f3357f521a1a87569c4b34 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 12 May 2025 18:17:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=8B=E6=B8=85=E7=90=86?= =?UTF-8?q?=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ycwl/basic/task/FaceCleaner.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/ycwl/basic/task/FaceCleaner.java b/src/main/java/com/ycwl/basic/task/FaceCleaner.java index 6a2008e..98d0543 100644 --- a/src/main/java/com/ycwl/basic/task/FaceCleaner.java +++ b/src/main/java/com/ycwl/basic/task/FaceCleaner.java @@ -126,7 +126,7 @@ public class FaceCleaner { }); } - @Scheduled(cron = "0 0 3 * * ?") + @Scheduled(cron = "0 0 1 * * ?") public void deleteNotBuySource(){ ScenicReqQuery scenicQuery = new ScenicReqQuery(); List scenicList = scenicMapper.list(scenicQuery); @@ -147,7 +147,7 @@ public class FaceCleaner { }); } - @Scheduled(cron = "0 15 3 * * ?") + @Scheduled(cron = "0 15 1 * * ?") public void deleteNotBuyVideos(){ ScenicReqQuery scenicQuery = new ScenicReqQuery(); List scenicList = scenicMapper.list(scenicQuery); @@ -168,7 +168,7 @@ public class FaceCleaner { }); } - @Scheduled(cron = "0 30 3 * * ?") + @Scheduled(cron = "0 30 1 * * ?") public void deleteExpiredSource(){ ScenicReqQuery scenicQuery = new ScenicReqQuery(); List scenicList = scenicMapper.list(scenicQuery); @@ -207,7 +207,7 @@ public class FaceCleaner { }); } - @Scheduled(cron = "0 0 1 * * ?") + @Scheduled(cron = "0 0 2 * * ?") public void clearOss(){ cleanFaceSampleOss(); cleanSourceOss(); @@ -225,13 +225,13 @@ public class FaceCleaner { return; } } - if(faceSampleRespVOS.parallelStream().noneMatch(faceSampleRespVO -> faceSampleRespVO.getFaceUrl().contains(fileObject.getFullPath()))){ + if(faceSampleRespVOS.parallelStream().noneMatch(faceSampleRespVO -> faceSampleRespVO.getFaceUrl().contains(fileObject.getName()))){ log.info("删除人脸文件:{}", fileObject); adapter.deleteFile(fileObject.getFullPath()); } }); } - private void cleanSourceOss() { + public void cleanSourceOss() { log.info("开始清理源视频素材文件"); List list = sourceMapper.list(new SourceReqQuery()); scenicMapper.list(new ScenicReqQuery()).forEach(scenic -> { @@ -245,7 +245,7 @@ public class FaceCleaner { return; } } - if (list.parallelStream().filter(videoRespVO -> Objects.nonNull(videoRespVO.getVideoUrl())).noneMatch(videoRespVO -> videoRespVO.getVideoUrl().contains(fileObject.getFullPath()))){ + if (list.parallelStream().filter(videoRespVO -> Objects.nonNull(videoRespVO.getVideoUrl())).noneMatch(videoRespVO -> videoRespVO.getVideoUrl().contains(fileObject.getName()))){ log.info("删除文件:{}", fileObject); adapter.deleteFile(fileObject.getFullPath()); } else { @@ -261,7 +261,7 @@ public class FaceCleaner { return; } } - if (list.parallelStream().filter(videoRespVO -> Objects.nonNull(videoRespVO.getUrl())).noneMatch(videoRespVO -> videoRespVO.getUrl().contains(fileObject.getFullPath()))){ + if (list.parallelStream().filter(videoRespVO -> Objects.nonNull(videoRespVO.getUrl())).noneMatch(videoRespVO -> videoRespVO.getUrl().contains(fileObject.getName()))){ log.info("删除文件:{}", fileObject); adapter.deleteFile(fileObject.getFullPath()); } else { @@ -270,7 +270,7 @@ public class FaceCleaner { }); }); } - private void cleanVideoOss() { + public void cleanVideoOss() { log.info("开始清理视频文件"); List list = videoMapper.list(new VideoReqQuery()); scenicMapper.list(new ScenicReqQuery()).forEach(scenic -> { @@ -284,7 +284,7 @@ public class FaceCleaner { return; } } - if (list.parallelStream().filter(videoRespVO -> Objects.nonNull(videoRespVO.getVideoUrl())).noneMatch(videoRespVO -> videoRespVO.getVideoUrl().contains(fileObject.getFullPath()))){ + if (list.parallelStream().filter(videoRespVO -> Objects.nonNull(videoRespVO.getVideoUrl())).noneMatch(videoRespVO -> videoRespVO.getVideoUrl().contains(fileObject.getName()))){ log.info("删除文件:{}", fileObject); adapter.deleteFile(fileObject.getFullPath()); } else {