mirror of
https://github.com/rclone/rclone.git
synced 2025-04-19 01:59:00 +08:00
Merge a27c8d73c57ff03fb851f661a44e8d01cffbdab3 into 4d38424e6cbb32d07c74d3b4d760af7afb35742d
This commit is contained in:
commit
84921f3e9d
@ -541,8 +541,8 @@ func SuffixName(ctx context.Context, remote string) string {
|
||||
// DeleteFileWithBackupDir deletes a single file respecting --dry-run
|
||||
// and accumulating stats and errors.
|
||||
//
|
||||
// If backupDir is set then it moves the file to there instead of
|
||||
// deleting
|
||||
// If backupDir is set then it moves the file to there instead of deleting
|
||||
// you use BackupDir to find the --backup-dir as it is relatively expensive so don't put it in a loop
|
||||
func DeleteFileWithBackupDir(ctx context.Context, dst fs.Object, backupDir fs.Fs) (err error) {
|
||||
tr := accounting.Stats(ctx).NewCheckingTransfer(dst, "deleting")
|
||||
defer func() {
|
||||
@ -575,8 +575,8 @@ func DeleteFileWithBackupDir(ctx context.Context, dst fs.Object, backupDir fs.Fs
|
||||
|
||||
// DeleteFile deletes a single file respecting --dry-run and accumulating stats and errors.
|
||||
//
|
||||
// If useBackupDir is set and --backup-dir is in effect then it moves
|
||||
// the file to there instead of deleting
|
||||
// call DeleteFileWithBackupDir if --backup-dir support is required
|
||||
// as calling this function with --backup-dir will always returns nil
|
||||
func DeleteFile(ctx context.Context, dst fs.Object) (err error) {
|
||||
return DeleteFileWithBackupDir(ctx, dst, nil)
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ func (s *syncCopyMove) pairChecker(in *pipe, out *pipe, fraction int, wg *sync.W
|
||||
return
|
||||
}
|
||||
} else {
|
||||
deleteFileErr := operations.DeleteFile(s.ctx, src)
|
||||
deleteFileErr := operations.DeleteFileWithBackupDir(s.ctx, src, s.backupDir)
|
||||
s.processError(deleteFileErr)
|
||||
s.logger(s.ctx, operations.TransferError, pair.Src, pair.Dst, deleteFileErr)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user