Skip to content

Commit

Permalink
feat: remove cache path from endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Dec 29, 2024
1 parent 4902b01 commit cb30b2a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/apis/applemusic/applemusic.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func Setup(router *chi.Mux) {
}

applemusicCache := cache.New("applemusic", data)
router.Get("/applemusic/cache", applemusicCache.ServeHTTP())
router.Handle("/applemusic/cache/ws", applemusicCache.ServeWS())
router.Get("/applemusic", applemusicCache.ServeHTTP())
router.Handle("/applemusic/ws", applemusicCache.ServeWS())
go applemusicCache.UpdatePeriodically(cacheUpdate, 30*time.Second)
lumber.Done("setup apple music cache")
}
4 changes: 2 additions & 2 deletions internal/apis/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func Setup(router *chi.Mux) {
}

githubCache := cache.New("github", pinnedRepos)
router.Get("/github/cache", githubCache.ServeHTTP())
router.Handle("/github/cache/ws", githubCache.ServeWS())
router.Get("/github", githubCache.ServeHTTP())
router.Handle("/github/ws", githubCache.ServeWS())
go githubCache.UpdatePeriodically(
func() ([]repository, error) { return fetchPinnedRepos(githubClient) },
2*time.Minute,
Expand Down
4 changes: 2 additions & 2 deletions internal/apis/steam/steam.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ func Setup(router *chi.Mux) {
}

steamCache := cache.New("steam", games)
router.Get("/steam/cache", steamCache.ServeHTTP())
router.Handle("/steam/cache/ws", steamCache.ServeWS())
router.Get("/steam", steamCache.ServeHTTP())
router.Handle("/steam/ws", steamCache.ServeWS())
go steamCache.UpdatePeriodically(fetchRecentlyPlayedGames, 5*time.Minute)
lumber.Done("setup steam cache")
}
4 changes: 2 additions & 2 deletions internal/apis/strava/strava.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func Setup(router *chi.Mux) {
lumber.ErrorMsg("failed to load initial data for strava cache; not updating")
}
stravaCache := cache.New("strava", stravaActivities)
router.Get("/strava/cache", stravaCache.ServeHTTP())
router.Handle("/strava/cache/ws", stravaCache.ServeWS())
router.Get("/strava", stravaCache.ServeHTTP())
router.Handle("/strava/ws", stravaCache.ServeWS())
router.Post("/strava/event", eventRoute(stravaCache, *minioClient, stravaTokens))
router.Get("/strava/event", challengeRoute)

Expand Down

0 comments on commit cb30b2a

Please sign in to comment.