mirror of https://github.com/status-im/consul.git
docker: close idle connections on stop
This commit is contained in:
parent
94726ef105
commit
e774b46f82
|
@ -573,6 +573,7 @@ func (c *CheckDocker) Stop() {
|
|||
}
|
||||
|
||||
func (c *CheckDocker) run() {
|
||||
defer c.Client.Close()
|
||||
firstWait := lib.RandomStagger(c.Interval)
|
||||
next := time.After(firstWait)
|
||||
for {
|
||||
|
|
|
@ -54,6 +54,13 @@ func NewDockerClient(host string, maxbuf int64) (*DockerClient, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (c *DockerClient) Close() error {
|
||||
if t, ok := c.client.Transport.(*http.Transport); ok {
|
||||
t.CloseIdleConnections()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *DockerClient) Host() string {
|
||||
return c.host
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue