1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-06 00:03:38 +00:00

Retry on any error in the hubic backend

This commit is contained in:
Gilbert Chen
2017-11-21 22:21:18 -05:00
parent c829b80527
commit 29bbd49a1c

View File

@@ -151,6 +151,13 @@ func (client *HubicClient) call(url string, method string, input interface{}, ex
response, err = client.HTTPClient.Do(request)
if err != nil {
if url != HubicCredentialURL {
retryAfter := time.Duration(rand.Float32() * 1000.0 * float32(backoff))
LOG_INFO("HUBIC_CALL", "%s %s returned an error: %v; retry after %d milliseconds", method, url, err, retryAfter)
time.Sleep(retryAfter * time.Millisecond)
backoff *= 2
continue
}
return nil, 0, "", err
}