mirror of
https://github.com/rclone/rclone
synced 2025-01-02 02:26:24 +01:00
mega: cleanup: add logs for -v and -vv
This commit is contained in:
parent
0e23c4542f
commit
d9cad9d10b
@ -413,13 +413,21 @@ func (f *Fs) CleanUp() (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "CleanUp failed to list items in trash")
|
return errors.Wrap(err, "CleanUp failed to list items in trash")
|
||||||
}
|
}
|
||||||
|
fs.Infof(f, "Deleting %d items from the trash", len(items))
|
||||||
|
errors := 0
|
||||||
// similar to f.deleteNode(trash) but with HardDelete as true
|
// similar to f.deleteNode(trash) but with HardDelete as true
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
err = f.pacer.Call(func() (bool, error) {
|
fs.Debugf(f, "Deleting trash %q", item.GetName())
|
||||||
err = f.srv.Delete(item, true)
|
deleteErr := f.pacer.Call(func() (bool, error) {
|
||||||
|
err := f.srv.Delete(item, true)
|
||||||
return shouldRetry(err)
|
return shouldRetry(err)
|
||||||
})
|
})
|
||||||
|
if deleteErr != nil {
|
||||||
|
err = deleteErr
|
||||||
|
errors++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
fs.Infof(f, "Deleted %d items from the trash with %d errors", len(items), errors)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user