From ac3f7a87c3315751a5fd07d15697c84905f33fef Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 16 Dec 2024 17:04:16 +0000 Subject: [PATCH] azureblob: speed up server side copies for small files #8249 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. --- backend/azureblob/azureblob.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go index d5733c910..441473e13 100644 --- a/backend/azureblob/azureblob.go +++ b/backend/azureblob/azureblob.go @@ -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)