mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-15 07:43:21 +00:00
Fixed #86: increase timeouts to handle overloaded Hubic servers
This commit is contained in:
@@ -6,6 +6,7 @@ package duplicacy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"time"
|
"time"
|
||||||
"sync"
|
"sync"
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -64,7 +65,17 @@ func NewHubicClient(tokenFile string) (*HubicClient, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
client := &HubicClient{
|
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,
|
TokenFile: tokenFile,
|
||||||
Token: token,
|
Token: token,
|
||||||
TokenLock: &sync.Mutex{},
|
TokenLock: &sync.Mutex{},
|
||||||
|
|||||||
Reference in New Issue
Block a user