2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: 备份目录不存在时不返回错误

This commit is contained in:
2026-01-23 17:43:06 +08:00
parent 05c22835e7
commit d24f02378e

View File

@@ -52,7 +52,10 @@ func (r *backupRepo) List(typ biz.BackupType) ([]*types.BackupFile, error) {
path := r.GetDefaultPath(typ)
files, err := os.ReadDir(path)
if err != nil {
return make([]*types.BackupFile, 0), nil
if errors.Is(err, os.ErrNotExist) {
return make([]*types.BackupFile, 0), nil
}
return nil, err
}
list := make([]*types.BackupFile, 0)