You've already forked FrameTour-BE
refactor(storage): 移除不再使用的人脸存储路径常量
All checks were successful
ZhenTu-BE/pipeline/head This commit looks good
All checks were successful
ZhenTu-BE/pipeline/head This commit looks good
- 删除 StorageConstant 中的 VIID_FACE 常量定义 - 移除 FaceCleaner 中对 VIID_FACE 的引用和相关文件清理逻辑 - 清理相关的导入语句和静态引用
This commit is contained in:
@@ -38,7 +38,6 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.ycwl.basic.constant.FaceConstant.USER_FACE_DB_NAME;
|
||||
import static com.ycwl.basic.constant.StorageConstant.VIID_FACE;
|
||||
|
||||
@Component
|
||||
@EnableScheduling
|
||||
@@ -229,19 +228,8 @@ public class FaceCleaner {
|
||||
log.info("开始清理人脸文件");
|
||||
List<FaceSampleRespVO> list = faceSampleMapper.list(new FaceSampleReqQuery());
|
||||
IStorageAdapter adapter = StorageFactory.use("faces");
|
||||
List<StorageFileObject> fileObjectList = adapter.listDir(VIID_FACE);
|
||||
fileObjectList.parallelStream().forEach(fileObject -> {
|
||||
if (fileObject.getModifyTime() != null) {
|
||||
// 如果是一天以内修改的,则跳过
|
||||
if (DateUtil.between(fileObject.getModifyTime(), new Date(), DateUnit.DAY) < 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(list.parallelStream().noneMatch(faceSampleRespVO -> faceSampleRespVO.getFaceUrl().contains(fileObject.getName()))){
|
||||
log.info("删除人脸文件:{}", fileObject);
|
||||
adapter.deleteFile(fileObject.getFullPath());
|
||||
}
|
||||
});
|
||||
// VIID相关功能已移除,不再清理VIID_FACE目录
|
||||
log.info("VIID人脸文件清理功能已移除");
|
||||
}
|
||||
public void cleanSourceOss() {
|
||||
log.info("开始清理源视频素材文件");
|
||||
|
||||
Reference in New Issue
Block a user