mirror of
https://github.com/rclone/rclone.git
synced 2025-03-04 10:22:08 +01:00
azureblob: fix errors not being retried when doing single part copy
Sometimes the Azure blob servers reply with 503 ServerBusy errors and these should be retried. Before this change, when testing to see if a single part server side copy was done, ServerBusy errors were returned to the user rather than being retried. Wrapping the call in the pacer fixes the problem and ensures it is retried properly using the --low-level-retries mechanism.
This commit is contained in:
parent
5037d7368d
commit
b7f26937f1
@ -1888,7 +1888,11 @@ func (f *Fs) copySinglepart(ctx context.Context, remote, dstContainer, dstPath s
|
|||||||
pollTime := 100 * time.Millisecond
|
pollTime := 100 * time.Millisecond
|
||||||
for copyStatus != nil && string(*copyStatus) == string(container.CopyStatusTypePending) {
|
for copyStatus != nil && string(*copyStatus) == string(container.CopyStatusTypePending) {
|
||||||
time.Sleep(pollTime)
|
time.Sleep(pollTime)
|
||||||
getMetadata, err := dstBlobSVC.GetProperties(ctx, &getOptions)
|
var getMetadata blob.GetPropertiesResponse
|
||||||
|
err = f.pacer.Call(func() (bool, error) {
|
||||||
|
getMetadata, err = dstBlobSVC.GetProperties(ctx, &getOptions)
|
||||||
|
return f.shouldRetry(ctx, err)
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user