Skip to content

Commit

Permalink
feat(minor): make repo fetch function private
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 dbc554a commit 32754df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
2 changes: 1 addition & 1 deletion pkg/apis/github/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 32754df

Please sign in to comment.