mirror of
https://github.com/rclone/rclone.git
synced 2026-10-28 06:18:39 -04:00
deleteEmptyDirectories gated on the cumulative accounting stats (accounting.Stats(ctx).Errored()) instead of the current operation's error. On a long-running rcd that reuses one stats group (rc "_group") across many sync/move calls, a single earlier error left Errored() true forever, which permanently disabled empty-source-directory deletion for every later, error-free operation sharing the group - each run just logged "not deleting directories as there were IO errors" and never cleaned up. Gate on s.currentError() instead, so empty-directory cleanup depends only on the current operation's outcome. This matches the per-operation guards already used elsewhere in run(), and is a no-op for normal single runs where Errored() (s.errors != 0) tracks the same errors that reach s.currentError().