mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-14 23:33:18 +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:
@@ -50,7 +50,7 @@ func TestB2Client(t *testing.T) {
|
||||
|
||||
b2Client.TestMode = true
|
||||
|
||||
err := b2Client.AuthorizeAccount(0)
|
||||
err, _ := b2Client.AuthorizeAccount(0)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to authorize the b2 account: %v", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user