Browse Source

Update weed/replication/sink/azuresink/azure_sink.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
pull/7310/head
Chris Lu 2 days ago
committed by GitHub
parent
commit
605e41cadf
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 17
      weed/replication/sink/azuresink/azure_sink.go

17
weed/replication/sink/azuresink/azure_sink.go

@ -74,10 +74,19 @@ func (g *AzureSink) initialize(accountName, accountKey, container, dir string) e
}
serviceURL := fmt.Sprintf("https://%s.blob.core.windows.net/", accountName)
client, err := azblob.NewClientWithSharedKeyCredential(serviceURL, credential, nil)
if err != nil {
return fmt.Errorf("failed to create Azure client: %v", err)
}
client, err := azblob.NewClientWithSharedKeyCredential(serviceURL, credential, &azblob.ClientOptions{
ClientOptions: azcore.ClientOptions{
Retry: policy.RetryOptions{
MaxRetries: 10,
TryTimeout: time.Minute,
RetryDelay: 2 * time.Second,
MaxRetryDelay: time.Minute,
},
},
})
if err != nil {
return fmt.Errorf("failed to create Azure client: %v", err)
}
g.client = client

Loading…
Cancel
Save