diff --git a/functions.go b/functions.go index a1a5313..d260f30 100644 --- a/functions.go +++ b/functions.go @@ -74,7 +74,6 @@ func DownloadFile(fpc *FuelPricesConfig, zipfile *ZipFile) error { if err != nil { return err } - defer resp.Body.Close() zipfile.Content, err = ioutil.ReadAll(resp.Body) @@ -153,6 +152,8 @@ func SendToInflux(fpc *FuelPricesConfig, prices *[]Price) error { return err } + defer httpClient.Close() + bp, err := client.NewBatchPoints(client.BatchPointsConfig{ Database: fpc.InfluxDB, })