2 Commits
Author SHA1 Message Date
yaemiku 2888fb2153 Merge branch 'master' 2026-02-19 03:26:22 +01:00
sentriz 25a061f44e fix(listenbrainz): disable keep-alive to avoid connection reset errors 2026-02-17 15:36:20 +00:00
+7 -1
View File
@@ -30,7 +30,13 @@ type Client struct {
} }
func NewClient() *Client { func NewClient() *Client {
return NewClientCustom(http.DefaultClient) // disable keep-alive to avoid "connection reset by peer" errors caused by a race between
// the server closing idle connections and the client reusing them for new requests
return NewClientCustom(&http.Client{
Transport: &http.Transport{
DisableKeepAlives: true,
},
})
} }
func NewClientCustom(httpClient *http.Client) *Client { func NewClientCustom(httpClient *http.Client) *Client {