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,8 +362,12 @@ func (l *SSHTunnelList) healthCheck(e sshTunnelEntry) error {
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
})
client := &http.Client{Transport: transport}
_, err := client.Get(l.healthCheckURL.String())
return err
resp, err := client.Get(l.healthCheckURL.String())
if err != nil {
return err
}
resp.Body.Close()
return nil
}
func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) {