mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 21:19:19 +00:00
tweak timeouts
This commit is contained in:
parent
ffc506371c
commit
8007853a9a
@ -8,6 +8,7 @@ import (
|
|||||||
"github.com/mmcdole/gofeed"
|
"github.com/mmcdole/gofeed"
|
||||||
"github.com/nkanaev/yarr/storage"
|
"github.com/nkanaev/yarr/storage"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
@ -258,10 +259,16 @@ func listItems(f storage.Feed) ([]storage.Item, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
transport := http.DefaultTransport.(*http.Transport).Clone()
|
transport := &http.Transport{
|
||||||
transport.DisableKeepAlives = true
|
Proxy: http.ProxyFromEnvironment,
|
||||||
|
DialContext: (&net.Dialer{
|
||||||
|
Timeout: 10 * time.Second,
|
||||||
|
}).DialContext,
|
||||||
|
DisableKeepAlives: true,
|
||||||
|
TLSHandshakeTimeout: time.Second * 10,
|
||||||
|
}
|
||||||
httpClient := &http.Client{
|
httpClient := &http.Client{
|
||||||
Timeout: time.Second * 5,
|
Timeout: time.Second * 30,
|
||||||
Transport: transport,
|
Transport: transport,
|
||||||
}
|
}
|
||||||
defaultClient = &Client{
|
defaultClient = &Client{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user