mirror of
https://github.com/rclone/rclone.git
synced 2025-08-18 09:30:03 +02:00
accounting: Add listed stat for number of directory entries listed
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/rclone/rclone/backend/crypt"
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/accounting"
|
||||
"github.com/rclone/rclone/fs/hash"
|
||||
"github.com/rclone/rclone/fs/walk"
|
||||
)
|
||||
@@ -283,7 +284,8 @@ func StatJSON(ctx context.Context, fsrc fs.Fs, remote string, opt *ListJSONOpt)
|
||||
return nil, nil
|
||||
}
|
||||
// Check the root directory exists
|
||||
_, err := fsrc.List(ctx, "")
|
||||
entries, err := fsrc.List(ctx, "")
|
||||
accounting.Stats(ctx).Listed(int64(len(entries)))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -322,6 +324,7 @@ func StatJSON(ctx context.Context, fsrc fs.Fs, remote string, opt *ListJSONOpt)
|
||||
parent = ""
|
||||
}
|
||||
entries, err := fsrc.List(ctx, parent)
|
||||
accounting.Stats(ctx).Listed(int64(len(entries)))
|
||||
if err == fs.ErrorDirNotFound {
|
||||
return nil, nil
|
||||
} else if err != nil {
|
||||
|
Reference in New Issue
Block a user