fix(目录健康检查): 目录健康检查批处理

This commit is contained in:
MAC 2022-05-08 10:37:17 +08:00
parent 3a4fd12acb
commit ecb32b05f7

View File

@ -35,10 +35,16 @@ public class TaskController {
public void updateElasticSearch() {
List<UserFile> userfileList = userFileService.list(new QueryWrapper<UserFile>().eq("deleteFlag", 0));
for (int i = 0; i < userfileList.size(); i++) {
QiwenFile ufopFile = new QiwenFile(userfileList.get(i).getFilePath(), userfileList.get(i).getFileName(), userfileList.get(i).getIsDir() == 1);
fileDealComp.restoreParentFilePath(ufopFile, userfileList.get(i).getUserId());
if (i % 1000 == 0 || i == userfileList.size() - 1) {
log.info("目录健康检查进度:" + (i + 1) + "/" + userfileList.size());
try {
QiwenFile ufopFile = new QiwenFile(userfileList.get(i).getFilePath(), userfileList.get(i).getFileName(), userfileList.get(i).getIsDir() == 1);
fileDealComp.restoreParentFilePath(ufopFile, userfileList.get(i).getUserId());
if (i % 1000 == 0 || i == userfileList.size() - 1) {
log.info("目录健康检查进度:" + (i + 1) + "/" + userfileList.size());
}
} catch (Exception e) {
log.error(e.getMessage());
}
}
userfileList = userFileService.list(new QueryWrapper<UserFile>().eq("deleteFlag", 0));