Skip to content

Commit

Permalink
Use maximum page size when listing teams (#199)
Browse files Browse the repository at this point in the history
This should reduce the total number of requests when operating in
organizations that have a lot of teams.
  • Loading branch information
bluekeyes authored Jun 29, 2020
1 parent edfaf84 commit cc0e1aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pull/github_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ func (mc *GitHubMembershipContext) getTeamID(team string) (int64, error) {
}

func (mc *GitHubMembershipContext) cacheTeamIDs(org string) error {
var opt github.ListOptions
opt := github.ListOptions{
PerPage: 100,
}

for {
teams, res, err := mc.client.Teams.ListTeams(mc.ctx, org, &opt)
if err != nil {
Expand Down

0 comments on commit cc0e1aa

Please sign in to comment.