mirror of https://github.com/cloudreve/Cloudreve
fix(dbfs): remove recursive limit for deleting files
parent
a16b491f65
commit
9b40e0146f
|
@ -760,7 +760,6 @@ func (f *DBFS) deleteFiles(ctx context.Context, targets map[Navigator][]*File, f
|
||||||
if f.user.Edges.Group == nil {
|
if f.user.Edges.Group == nil {
|
||||||
return nil, nil, fmt.Errorf("user group not loaded")
|
return nil, nil, fmt.Errorf("user group not loaded")
|
||||||
}
|
}
|
||||||
limit := max(f.user.Edges.Group.Settings.MaxWalkedFiles, 1)
|
|
||||||
allStaleEntities := make([]fs.Entity, 0, len(targets))
|
allStaleEntities := make([]fs.Entity, 0, len(targets))
|
||||||
storageDiff := make(inventory.StorageDiff)
|
storageDiff := make(inventory.StorageDiff)
|
||||||
for n, files := range targets {
|
for n, files := range targets {
|
||||||
|
@ -774,8 +773,7 @@ func (f *DBFS) deleteFiles(ctx context.Context, targets map[Navigator][]*File, f
|
||||||
|
|
||||||
// List all files to be deleted
|
// List all files to be deleted
|
||||||
toBeDeletedFiles := make([]*File, 0, len(files))
|
toBeDeletedFiles := make([]*File, 0, len(files))
|
||||||
if err := n.Walk(ctx, files, limit, intsets.MaxInt, func(targets []*File, level int) error {
|
if err := n.Walk(ctx, files, intsets.MaxInt, intsets.MaxInt, func(targets []*File, level int) error {
|
||||||
limit -= len(targets)
|
|
||||||
toBeDeletedFiles = append(toBeDeletedFiles, targets...)
|
toBeDeletedFiles = append(toBeDeletedFiles, targets...)
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue