mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Merge pull request #605 from weaveworks/604-close-idle-http
Close idle http connections when we stop a Http Publisher.
This commit is contained in:
@@ -119,7 +119,12 @@ func (p HTTPPublisher) Publish(r io.Reader) error {
|
||||
}
|
||||
|
||||
// Stop implements Publisher
|
||||
func (p HTTPPublisher) Stop() {}
|
||||
func (p *HTTPPublisher) Stop() {
|
||||
// We replace the HTTPPublishers pretty regularly, so we need to ensure the
|
||||
// underlying connections get closed, or we end up with lots of idle
|
||||
// goroutines on the server (see #604)
|
||||
p.client.Transport.(*http.Transport).CloseIdleConnections()
|
||||
}
|
||||
|
||||
// AuthorizationHeader returns a value suitable for an HTTP Authorization
|
||||
// header, based on the passed token string.
|
||||
|
||||
Reference in New Issue
Block a user