Compress again too

This commit is contained in:
Daniel Nelson
2019-09-20 11:28:34 -07:00
parent 6145b55b61
commit 2e93cbe7e1
+6
View File
@@ -220,6 +220,12 @@ func (c *httpClient) writeBatch(ctx context.Context, bucket string, metrics []te
req.GetBody = func() (io.ReadCloser, error) {
body := influx.NewReader(metrics, c.serializer)
if c.ContentEncoding == "gzip" {
body, err = internal.CompressWithGzip(body)
if err != nil {
return nil, err
}
}
rc := ioutil.NopCloser(body)
return rc, nil
}