chore: added defer for influxdb connection

This commit is contained in:
Paul Lecuq 2019-08-22 09:57:43 +02:00
parent 99ce74161a
commit 329f1c7752

View File

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