Skip to content

Commit

Permalink
Add Client.MaxConnDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Nov 10, 2019
1 parent 3fb2eba commit 5f66658
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ type Client struct {
// after DefaultMaxIdleConnDuration.
MaxIdleConnDuration time.Duration

// Keep-alive connections are closed after this duration.
//
// By default connection duration is unlimited.
MaxConnDuration time.Duration

// Maximum number of attempts for idempotent calls
//
// DefaultMaxIdemponentCallAttempts is used if not set.
Expand Down Expand Up @@ -425,6 +430,7 @@ func (c *Client) Do(req *Request, resp *Response) error {
TLSConfig: c.TLSConfig,
MaxConns: c.MaxConnsPerHost,
MaxIdleConnDuration: c.MaxIdleConnDuration,
MaxConnDuration: c.MaxConnDuration,
MaxIdemponentCallAttempts: c.MaxIdemponentCallAttempts,
ReadBufferSize: c.ReadBufferSize,
WriteBufferSize: c.WriteBufferSize,
Expand Down

1 comment on commit 5f66658

@erikdubbelboer
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #692

Please sign in to comment.