Close idle connections in influxdb outputs when reloading (#5912)
This commit is contained in:
15
internal/http_go1.11.go
Normal file
15
internal/http_go1.11.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// +build !go1.12
|
||||
|
||||
package internal
|
||||
|
||||
import "net/http"
|
||||
|
||||
func CloseIdleConnections(c *http.Client) {
|
||||
type closeIdler interface {
|
||||
CloseIdleConnections()
|
||||
}
|
||||
|
||||
if tr, ok := c.Transport.(closeIdler); ok {
|
||||
tr.CloseIdleConnections()
|
||||
}
|
||||
}
|
||||
9
internal/http_go1.12.go
Normal file
9
internal/http_go1.12.go
Normal file
@@ -0,0 +1,9 @@
|
||||
// +build go1.12
|
||||
|
||||
package internal
|
||||
|
||||
import "net/http"
|
||||
|
||||
func CloseIdleConnections(c *http.Client) {
|
||||
c.CloseIdleConnections()
|
||||
}
|
||||
Reference in New Issue
Block a user