mirror of
https://github.com/rclone/rclone.git
synced 2025-08-27 13:16:21 +02:00
drive: Use o.Update and fs.Put to optimise transfers
This commit is contained in:
@@ -111,9 +111,12 @@ func Copy(f Fs, dst, src Object) {
|
||||
}
|
||||
in := NewAccount(in0) // account the transfer
|
||||
|
||||
var actionTaken string
|
||||
if dst != nil {
|
||||
actionTaken = "Copied (updated existing)"
|
||||
err = dst.Update(in, src.ModTime(), src.Size())
|
||||
} else {
|
||||
actionTaken = "Copied (new)"
|
||||
dst, err = f.Put(in, src.Remote(), src.ModTime(), src.Size())
|
||||
}
|
||||
inErr := in.Close()
|
||||
@@ -133,7 +136,7 @@ func Copy(f Fs, dst, src Object) {
|
||||
}
|
||||
return
|
||||
}
|
||||
Debug(src, "Copied")
|
||||
Debug(src, actionTaken)
|
||||
}
|
||||
|
||||
// Check to see if src needs to be copied to dst and if so puts it in out
|
||||
|
Reference in New Issue
Block a user