Fix goroutine leak in ssh-tunnel healthcheck.

This commit is contained in:
CJ Cullen 2016-04-19 10:42:58 -07:00
parent 4638f2f355
commit cba5e84fd1

View File

@ -362,9 +362,13 @@ func (l *SSHTunnelList) healthCheck(e sshTunnelEntry) error {
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}) })
client := &http.Client{Transport: transport} client := &http.Client{Transport: transport}
_, err := client.Get(l.healthCheckURL.String()) resp, err := client.Get(l.healthCheckURL.String())
if err != nil {
return err return err
} }
resp.Body.Close()
return nil
}
func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) { func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) {
// Find the entry to replace. // Find the entry to replace.