Explorar o código

tech(influxdb): close body reader

bergquist %!s(int64=9) %!d(string=hai) anos
pai
achega
98a7bf181a
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      pkg/tsdb/influxdb/influxdb.go

+ 2 - 0
pkg/tsdb/influxdb/influxdb.go

@@ -68,8 +68,10 @@ func (e *InfluxDBExecutor) Execute(ctx context.Context, queries tsdb.QuerySlice,
 
 	var response Response
 	dec := json.NewDecoder(resp.Body)
+	defer resp.Body.Close()
 	dec.UseNumber()
 	err = dec.Decode(&response)
+
 	if err != nil {
 		return result.WithError(err)
 	}