Skip to content

Commit

Permalink
limit event counts
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Sep 17, 2023
1 parent 00b8af7 commit 004d601
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/github/github.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Octokit } from 'octokit';
@ApiTags('Github')
@Controller('github')
export class GithubController {
// It's ok to access GitHub API without token, but it's limited to 60 requests per hour.
// TODO: maybe caching the response to help this limit.
gh_token = process.env.GITHUB_TOKEN;

@Get()
Expand All @@ -28,6 +30,6 @@ export class GithubController {
@Get('event')
getGithubEvent() {
const octokit = new Octokit({ auth: this.gh_token });
return octokit.request('GET /orgs/poapper/events');
return octokit.request('GET /orgs/poapper/events?per_page=10');
}
}

0 comments on commit 004d601

Please sign in to comment.