Merge branch 'master' of ssh://git.paulbsd.com:2222/paulbsd/weather

This commit is contained in:
Paul 2019-09-08 12:41:48 +02:00
commit 1aad5fd64c

View File

@ -65,6 +65,8 @@ func FetchData(wc *WeatherConfig, city string) (Data, error) {
return Data{}, err
}
defer r.Body.Close()
b, err := ioutil.ReadAll(r.Body)
if err != nil {
return Data{}, err
@ -93,6 +95,7 @@ func SendToInflux(wc *WeatherConfig, d Data) error {
if err != nil {
return err
}
defer httpClient.Close()
bp, err := client.NewBatchPoints(client.BatchPointsConfig{
Database: wc.InfluxDB,