From 329f1c7752d61b932e179be3884a1824a1393d6c Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 22 Aug 2019 09:57:43 +0200 Subject: [PATCH] chore: added defer for influxdb connection --- functions.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, })