mirror of
https://github.com/rclone/rclone.git
synced 2025-12-12 06:24:14 +01:00
stats: add counter for deleted directories - fixes #4676
This commit is contained in:
@@ -935,6 +935,7 @@ func Mkdir(ctx context.Context, f fs.Fs, dir string) error {
|
||||
// TryRmdir removes a container but not if not empty. It doesn't
|
||||
// count errors but may return one.
|
||||
func TryRmdir(ctx context.Context, f fs.Fs, dir string) error {
|
||||
accounting.Stats(ctx).DeletedDirs(1)
|
||||
if SkipDestructive(ctx, fs.LogDirName(f, dir), "remove directory") {
|
||||
return nil
|
||||
}
|
||||
@@ -957,6 +958,7 @@ func Purge(ctx context.Context, f fs.Fs, dir string) (err error) {
|
||||
doFallbackPurge := true
|
||||
if doPurge := f.Features().Purge; doPurge != nil {
|
||||
doFallbackPurge = false
|
||||
accounting.Stats(ctx).DeletedDirs(1)
|
||||
if SkipDestructive(ctx, fs.LogDirName(f, dir), "purge directory") {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user