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

Fixed #86: increase timeouts to handle overloaded Hubic servers

This commit is contained in:
Gilbert Chen
2017-07-07 20:08:09 -04:00
parent cdd1f26079
commit b4f3142275

View File

@@ -6,6 +6,7 @@ package duplicacy
import (
"fmt"
"net"
"time"
"sync"
"bytes"
@@ -64,7 +65,17 @@ func NewHubicClient(tokenFile string) (*HubicClient, error) {
}
client := &HubicClient{
HTTPClient: http.DefaultClient,
HTTPClient: &http.Client {
Transport: &http.Transport {
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 60 * time.Second,
ResponseHeaderTimeout: 30 * time.Second,
ExpectContinueTimeout: 10 * time.Second,
},
},
TokenFile: tokenFile,
Token: token,
TokenLock: &sync.Mutex{},