MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadUnknownApps

Function loadUnknownApps

agent/app/service/device_clean.go:380–403  ·  view source on GitHub ↗
(fileOp fileUtils.FileOp, recordMap map[string][]string)

Source from the content-addressed store, hash-verified

378}
379
380func loadUnknownApps(fileOp fileUtils.FileOp, recordMap map[string][]string) dto.CleanTree {
381 apps, _ := appInstallRepo.ListBy(context.Background())
382 var excludePaths []string
383 for _, app := range apps {
384 itemName := fmt.Sprintf("app/%s/%s", app.App.Key, app.Name)
385 if val, ok := recordMap[itemName]; ok {
386 for _, item := range val {
387 excludePaths = append(excludePaths, path.Join(global.Dir.LocalBackupDir, itemName, item))
388 }
389 }
390 }
391 backupPath := path.Join(global.Dir.LocalBackupDir, "app")
392 treeData := dto.CleanTree{
393 ID: uuid.NewString(),
394 Label: "unknown_app",
395 IsCheck: false,
396 IsRecommend: false,
397 CanDelete: false,
398 Name: backupPath,
399 Type: "unknown_backup",
400 }
401 _ = loadFileOrDirWithExclude(fileOp, 0, backupPath, &treeData, excludePaths)
402 return treeData
403}
404func loadUnknownDbs(fileOp fileUtils.FileOp, recordMap map[string][]string) dto.CleanTree {
405 dbs, _ := databaseRepo.GetList()
406 var excludePaths []string

Callers 1

loadBackupTreeFunction · 0.85

Calls 2

loadFileOrDirWithExcludeFunction · 0.85
ListByMethod · 0.65

Tested by

no test coverage detected