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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
13 additions and
4 deletions
-
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) |
|
|
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 |
|
|
g.client = client |
|
|
|
|
|
|
|
|