From 5bfc9787cb67a5d9a1c2fc998a89b4226cc9bfb8 Mon Sep 17 00:00:00 2001 From: Nathaniel Waisbrot Date: Mon, 1 Jan 2024 17:13:36 -0500 Subject: [PATCH] unable to go lower than 1h --- birdweather/forStation.go | 6 +++--- cmd/hourlyMetrics.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/birdweather/forStation.go b/birdweather/forStation.go index 845afee..731ab43 100644 --- a/birdweather/forStation.go +++ b/birdweather/forStation.go @@ -32,11 +32,11 @@ func BirdsForStation(stationid string) (string, []structs.BirdCount) { return counts.Station.Name, result } -func RecordCountsForStationPastMinutes(stationId string, minutes int) { +func RecordCountsForStationPastMinutes(stationId string, hours int) { client := graphql.NewClient("https://app.birdweather.com/graphql", http.DefaultClient) duration := InputDuration{ - Count: minutes, - Unit: "minute", + Count: hours, + Unit: "hour", } counts, err := hourlyCounts(context.Background(), client, stationId, duration) if err != nil { diff --git a/cmd/hourlyMetrics.go b/cmd/hourlyMetrics.go index f9ea88b..e5509bf 100644 --- a/cmd/hourlyMetrics.go +++ b/cmd/hourlyMetrics.go @@ -20,7 +20,7 @@ var hourlyMetricsCmd = &cobra.Command{ stationIds := viper.GetIntSlice("stations") for _, stationId := range stationIds { fmt.Printf("Recording counts for station %d\n", stationId) - birdweather.RecordCountsForStationPastMinutes(fmt.Sprint(stationId), 30) + birdweather.RecordCountsForStationPastMinutes(fmt.Sprint(stationId), 1) } }, }