Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oscaromeu committed Dec 5, 2021
1 parent 29825b3 commit e5264ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions examples/influxdb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ func (c *Calculation) currentDecrecment(ts string, tz string) {
}
res, err := client.Do(req)

fmt.Println(res)
if err != nil {
fmt.Println(err)
return
Expand Down Expand Up @@ -241,7 +240,8 @@ func main() {
)

d.OpenDataMeasurementAllByStation(p)
fmt.Println(d.OpenData)
log.Info("Gathered data")
log.Info(d.OpenData)
str := fmt.Sprintf("%s-%s-%sT%s:%s:%s", p.Any, p.Mes, p.Dia, p.Hour, p.Minute, p.Seconds)

tt, err := time.Parse(layout, str)
Expand All @@ -258,6 +258,7 @@ func main() {
Fields, tt)
// write point asynchronously
writeAPI.WritePoint(context.Background(), p)

}
// always close client at the end
defer c.Close()
Expand Down
2 changes: 1 addition & 1 deletion opendata.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (s *OpenDataMeasurements) OpenDataMeasurementAllByStation(p *Parameters) er
req, err := http.NewRequest("GET", fmt.Sprintf(
openDataURL, fmt.Sprintf("?data_lectura=%s-%s-%sT%s:%s:%s",
p.Any, p.Mes, p.Dia, p.Hour, p.Minute, p.Seconds)), nil) // 2021-12-05T04:30:00.000
fmt.Println(req)

if err != nil {
return err
}
Expand Down

0 comments on commit e5264ea

Please sign in to comment.