mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
Use walk.ListR for listing operations
This will increase speed for backends which support ListR and will not have the memory overhead of using --fast-list. It also means that errors are queued until the end so as much of the remote will be listed as possible before returning an error. Commands affected are: - lsf - ls - lsl - lsjson - lsd - md5sum/sha1sum/hashsum - size - delete - cat - settier
This commit is contained in:
@@ -89,12 +89,7 @@ func ListJSON(fsrc fs.Fs, remote string, opt *ListJSONOpt, callback func(*ListJS
|
||||
}
|
||||
}
|
||||
format := formatForPrecision(fsrc.Precision())
|
||||
err := walk.Walk(fsrc, remote, false, ConfigMaxDepth(opt.Recurse), func(dirPath string, entries fs.DirEntries, err error) error {
|
||||
if err != nil {
|
||||
fs.CountError(err)
|
||||
fs.Errorf(dirPath, "error listing: %v", err)
|
||||
return nil
|
||||
}
|
||||
err := walk.ListR(fsrc, remote, false, ConfigMaxDepth(opt.Recurse), walk.ListAll, func(entries fs.DirEntries) (err error) {
|
||||
for _, entry := range entries {
|
||||
item := ListJSONItem{
|
||||
Path: entry.Remote(),
|
||||
|
||||
Reference in New Issue
Block a user