Skip to content

Commit

Permalink
chore(github): fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Gomez committed Feb 5, 2024
1 parent 51123d2 commit 21bc0c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/sources/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ func (s *Source) enumerateWithApp(ctx context.Context, apiEndpoint string, app *
// Does this need to be separate from |s.httpClient|?
instHTTPClient := common.RetryableHttpClientTimeout(60)
instHTTPClient.Transport = appItr
installationClient, err = github.NewEnterpriseClient(apiEndpoint, apiEndpoint, instHTTPClient)
installationClient, err = github.NewClient(instHTTPClient).WithEnterpriseURLs(apiEndpoint, apiEndpoint)
if err != nil {
return nil, err
}
Expand All @@ -713,7 +713,7 @@ func (s *Source) enumerateWithApp(ctx context.Context, apiEndpoint string, app *
itr.BaseURL = apiEndpoint

s.httpClient.Transport = itr
s.apiClient, err = github.NewEnterpriseClient(apiEndpoint, apiEndpoint, s.httpClient)
s.apiClient, err = github.NewClient(s.httpClient).WithEnterpriseURLs(apiEndpoint, apiEndpoint)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -753,7 +753,7 @@ func createGitHubClient(httpClient *http.Client, apiEndpoint string) (*github.Cl
return github.NewClient(httpClient), nil
}

return github.NewEnterpriseClient(apiEndpoint, apiEndpoint, httpClient)
return github.NewClient(httpClient).WithEnterpriseURLs(apiEndpoint, apiEndpoint)
}

func (s *Source) scan(ctx context.Context, installationClient *github.Client, chunksChan chan *sources.Chunk) error {
Expand Down Expand Up @@ -929,7 +929,7 @@ func (s *Source) handleRateLimit(errIn error) bool {

rateLimitMu.Unlock()
} else {
retryAfter = resumeTime.Sub(time.Now())
retryAfter = time.Until(resumeTime)
}

githubNumRateLimitEncountered.WithLabelValues(s.name).Inc()
Expand Down

0 comments on commit 21bc0c0

Please sign in to comment.