mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 06:47:20 +08:00
feat: 备份目录不存在时不返回错误
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user