Merge pull request #474 from stevvooe/goroutine-leak-notifications

Address possible goroutine leak in notification library
This commit is contained in:
Stephen Day 2015-04-29 18:48:15 -07:00
commit 3283ef1949

View file

@ -53,6 +53,7 @@ type httpStatusListener interface {
func (hs *httpSink) Write(events ...Event) error {
hs.mu.Lock()
defer hs.mu.Unlock()
defer hs.client.Transport.(*headerRoundTripper).CloseIdleConnections()
if hs.closed {
return ErrSinkClosed
@ -83,6 +84,7 @@ func (hs *httpSink) Write(events ...Event) error {
return fmt.Errorf("%v: error posting: %v", hs, err)
}
defer resp.Body.Close()
// The notifier will treat any 2xx or 3xx response as accepted by the
// endpoint.