Skip to content

Commit

Permalink
Don't close idle connections when context was cancelled
Browse files Browse the repository at this point in the history
If the user no longer wants to wait, it's not a reason to drop all keep-alive connections.
  • Loading branch information
ash2k committed Sep 21, 2021
1 parent f381b58 commit 7e1be79
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,6 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
select {
case <-req.Context().Done():
timer.Stop()
c.HTTPClient.CloseIdleConnections()
return nil, req.Context().Err()
case <-timer.C:
}
Expand Down

0 comments on commit 7e1be79

Please sign in to comment.