fix: Fixed issue with website log display error in clean cache (#11607)

This commit is contained in:
CityFun
2026-01-09 04:01:51 +00:00
committed by GitHub
parent 2fcab77565
commit 8e8f181cae
2 changed files with 11 additions and 3 deletions
+7 -2
View File
@@ -497,14 +497,19 @@ func loadUnknownWebsiteLog(fileOp fileUtils.FileOp, recordMap map[string][]strin
Type: "unknown_backup",
}
dir := path.Join(global.Dir.LocalBackupDir, "log/website")
websites, _ := websiteRepo.List()
websiteMap := make(map[string]struct{})
for _, website := range websites {
websiteMap[website.Alias] = struct{}{}
}
entries, _ := os.ReadDir(dir)
for _, entry := range entries {
if !entry.IsDir() {
continue
}
dirName := entry.Name()
itemName := fmt.Sprintf("log/website/%s", dirName)
if _, ok := recordMap[itemName]; !ok {
if _, ok := websiteMap[dirName]; !ok {
dirPath := path.Join(dir, dirName)
itemSize, _ := fileOp.GetDirSize(dirPath)
childData := dto.CleanTree{
+4 -1
View File
@@ -402,8 +402,11 @@ const loadSubmitCheck = (data: any) => {
}
return;
}
for (const item of data) {
if (item.label === 'unknown_website_log' && item.isCheck && item.children) {
loadSubmitCheck(item.children);
continue;
}
if (item.isCheck && item.type !== 'app_tmp_download') {
submitCleans.value.push({ treeType: item.type, name: item.name, size: item.size });
continue;