1
mirror of https://github.com/rclone/rclone synced 2025-02-18 14:11:27 +01:00

azureblob: speed up server side copies for small files

This speeds up server side copies for small files which need the check
the copy status by using an exponential ramp up of time to check the
copy status endpoint.
This commit is contained in:
Nick Craig-Wood 2024-12-16 17:04:16 +00:00
parent 4e9b63e141
commit ac3f7a87c3

View File

@ -1649,13 +1649,15 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
copyStatus := startCopy.CopyStatus
getOptions := blob.GetPropertiesOptions{}
pollTime := 100 * time.Millisecond
for copyStatus != nil && string(*copyStatus) == string(container.CopyStatusTypePending) {
time.Sleep(1 * time.Second)
time.Sleep(pollTime)
getMetadata, err := dstBlobSVC.GetProperties(ctx, &getOptions)
if err != nil {
return nil, err
}
copyStatus = getMetadata.CopyStatus
pollTime = min(2*pollTime, time.Second)
}
return f.NewObject(ctx, remote)