Fix influxdb output serialization on connection closed (#6621)
This commit is contained in:
@@ -176,10 +176,12 @@ func (h *HTTP) write(reqBody []byte) error {
|
||||
|
||||
var err error
|
||||
if h.ContentEncoding == "gzip" {
|
||||
reqBodyBuffer, err = internal.CompressWithGzip(reqBodyBuffer)
|
||||
rc, err := internal.CompressWithGzip(reqBodyBuffer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer rc.Close()
|
||||
reqBodyBuffer = rc
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(h.Method, h.URL, reqBodyBuffer)
|
||||
|
||||
Reference in New Issue
Block a user