Skip to content

Commit

Permalink
feat: github updates every 2 minutes and steam updates every 10 minutes
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Jul 30, 2024
1 parent f323a8e commit 399d84b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func main() {
githubCache := cache.NewCache("github", github.FetchPinnedRepos(githubClient))
r.Get("/github/cache", githubCache.ServeHTTP())
lumber.Success("setup github cache")
go githubCache.StartPeriodicUpdate(func() []github.Repository { return github.FetchPinnedRepos(githubClient) }, 5*time.Minute)
go githubCache.StartPeriodicUpdate(func() []github.Repository { return github.FetchPinnedRepos(githubClient) }, 2*time.Minute)

stravaTokens := strava.LoadTokens()
stravaTokens.RefreshIfNeeded()
Expand All @@ -73,7 +73,7 @@ func main() {
steamCache := cache.NewCache("steam", games)
r.Get("/steam/cache", steamCache.ServeHTTP())
lumber.Success("setup steam cache")
go steamCache.StartPeriodicUpdate(steam.FetchRecentlyPlayedGames, 5*time.Minute)
go steamCache.StartPeriodicUpdate(steam.FetchRecentlyPlayedGames, 10*time.Minute)

lumber.Info("starting server")
err = http.ListenAndServe(":8000", r)
Expand Down

0 comments on commit 399d84b

Please sign in to comment.