diff --git a/pkg/apis/github/github.go b/pkg/apis/github/github.go index f2b349f..d8b7e5a 100644 --- a/pkg/apis/github/github.go +++ b/pkg/apis/github/github.go @@ -18,8 +18,8 @@ func Setup(router *chi.Mux) { ) githubHttpClient := oauth2.NewClient(context.Background(), githubTokenSource) githubClient := githubv4.NewClient(githubHttpClient) - githubCache := cache.NewCache("github", FetchPinnedRepos(githubClient)) + githubCache := cache.NewCache("github", fetchPinnedRepos(githubClient)) router.Get("/github/cache", githubCache.ServeHTTP()) - go githubCache.StartPeriodicUpdate(func() []repository { return FetchPinnedRepos(githubClient) }, 2*time.Minute) + go githubCache.StartPeriodicUpdate(func() []repository { return fetchPinnedRepos(githubClient) }, 2*time.Minute) lumber.Success("setup github cache") } diff --git a/pkg/apis/github/repos.go b/pkg/apis/github/repos.go index c897e33..c3a18d8 100644 --- a/pkg/apis/github/repos.go +++ b/pkg/apis/github/repos.go @@ -46,7 +46,7 @@ type repository struct { URL string `json:"url"` } -func FetchPinnedRepos(client *githubv4.Client) []repository { +func fetchPinnedRepos(client *githubv4.Client) []repository { var query pinnedItemsQuery err := client.Query(context.Background(), &query, nil) if err != nil {