Fix: aria2 RPC retry / return NoT_FOUND error while listing not existed path

This commit is contained in:
HFO4
2020-02-10 10:33:39 +08:00
parent 7a6c84a115
commit f235ad1def
11 changed files with 125 additions and 16 deletions

View File

@@ -253,9 +253,8 @@ func (fs *FileSystem) ListDeleteFiles(ctx context.Context, ids []uint) error {
func (fs *FileSystem) List(ctx context.Context, dirPath string, pathProcessor func(string) string) ([]Object, error) {
// 获取父目录
isExist, folder := fs.IsPathExist(dirPath)
// 不存在时返回空的结果
if !isExist {
return []Object{}, nil
return nil, ErrPathNotExist
}
fs.SetTargetDir(&[]model.Folder{*folder})