parent
51c952654c
commit
3c2252b7c0
1 changed files with 7 additions and 2 deletions
|
@ -405,7 +405,7 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
|
||||||
if err == nil {
|
if err == nil {
|
||||||
dst = newDst
|
dst = newDst
|
||||||
in.ServerSideCopyEnd(dst.Size()) // account the bytes for the server-side transfer
|
in.ServerSideCopyEnd(dst.Size()) // account the bytes for the server-side transfer
|
||||||
err = in.Close()
|
_ = in.Close()
|
||||||
} else {
|
} else {
|
||||||
_ = in.Close()
|
_ = in.Close()
|
||||||
}
|
}
|
||||||
|
@ -598,6 +598,8 @@ func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Move dst <- src
|
// Move dst <- src
|
||||||
|
in := tr.Account(ctx, nil) // account the transfer
|
||||||
|
in.ServerSideCopyStart()
|
||||||
newDst, err = doMove(ctx, src, remote)
|
newDst, err = doMove(ctx, src, remote)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
|
@ -606,13 +608,16 @@ func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.
|
||||||
} else {
|
} else {
|
||||||
fs.Infof(src, "Moved (server-side)")
|
fs.Infof(src, "Moved (server-side)")
|
||||||
}
|
}
|
||||||
|
in.ServerSideCopyEnd(newDst.Size()) // account the bytes for the server-side transfer
|
||||||
|
_ = in.Close()
|
||||||
return newDst, nil
|
return newDst, nil
|
||||||
case fs.ErrorCantMove:
|
case fs.ErrorCantMove:
|
||||||
fs.Debugf(src, "Can't move, switching to copy")
|
fs.Debugf(src, "Can't move, switching to copy")
|
||||||
|
_ = in.Close()
|
||||||
default:
|
default:
|
||||||
err = fs.CountError(err)
|
err = fs.CountError(err)
|
||||||
fs.Errorf(src, "Couldn't move: %v", err)
|
fs.Errorf(src, "Couldn't move: %v", err)
|
||||||
|
_ = in.Close()
|
||||||
return newDst, err
|
return newDst, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue