mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-23 03:33:15 +00:00
Better handling of B2 authorization failures
This commit fixed 2 issues wrt Backblaze B2 authorization: * every thread may call b2_authorize_account at the same time when there are 401 errors * if B2 has a login outage, then all threads will call b2_authorize_account repeatedly without delay A simple solution is to limit one b2_authorize_account call to once every 30 second regardless of how many threads there are. If the call to b2_authorize_account is not allowed, the random exponential backoff will be performed.
This commit is contained in:
@@ -19,7 +19,7 @@ func CreateB2Storage(accountID string, applicationKey string, bucket string, sto
|
||||
|
||||
client := NewB2Client(accountID, applicationKey, storageDir, threads)
|
||||
|
||||
err = client.AuthorizeAccount(0)
|
||||
err, _ = client.AuthorizeAccount(0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user