Do not reuse connection to prevent EOF error, #1295

This commit is contained in:
Alexander Zobnin
2021-09-10 16:41:36 +03:00
parent f4f346aceb
commit a69c866b4e

View File

@@ -157,6 +157,9 @@ func handleAPIResult(response []byte) (*simplejson.Json, error) {
} }
func makeHTTPRequest(ctx context.Context, httpClient *http.Client, req *http.Request) ([]byte, error) { func makeHTTPRequest(ctx context.Context, httpClient *http.Client, req *http.Request) ([]byte, error) {
// Set to true to prevents re-use of TCP connections (this may cause random EOF error in some request)
req.Close = true
res, err := ctxhttp.Do(ctx, httpClient, req) res, err := ctxhttp.Do(ctx, httpClient, req)
if err != nil { if err != nil {
return nil, err return nil, err