This commit is contained in:
luke 2025-06-21 22:31:18 +08:00
parent b82f44543e
commit d90217c0ee

View File

@ -99,12 +99,15 @@ public class DocAppServiceImpl implements DocAppService{
}
});
if(clearAll) {
List<String> allSearchableFilesRelaPath = osRecordDTOS.stream()
.filter(e -> e.getSearchableStatus() == SearchableStatusEnum.SUCCESS.code)
.map(OSRecordDTO::getLocalRelaFilePath).collect(Collectors.toList());
// 删除本地文件
LocalFileUtil.deleteFilesByRelativePath(osProperties.getLocalSearchablePathPrefix(), filesLocalRelaPath);
LocalFileUtil.deleteFilesByRelativePath(osProperties.getLocalSearchablePathPrefix(), allSearchableFilesRelaPath);
// 删除ES
esGateway.deleteByFilepaths(filesLocalRelaPath);
esGateway.deleteByFilepaths(allSearchableFilesRelaPath);
// 删除缓存
fileCacheService.removeMetaCacheBatch(filesLocalRelaPath);
fileCacheService.removeMetaCacheBatch(allSearchableFilesRelaPath);
}
return true;
} catch (Exception e) {