Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the scheduled event governor based upon the actions rate limit #5816

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

JimSuplizio
Copy link
Member

@JimSuplizio JimSuplizio commented Mar 24, 2023

Previously, I was ultra-conservative on the governor for scheduled events. The limit was set to 100 items per scheduled task run which is still correct for non-enterprise repository actions. For enterprise, however, the actions rate limit is 15,000 and, in that case, we can allow the scheduled tasks to process up to 1000, which is the number of results you can get back from search calls in a given time without hitting the secondary rate limit.

I also put the scheduled event into a try/finally since, we can hit the secondary rate limit on subsequent calls to get the next page of results. If that happens, we still need to process any pending changes made from previous pages of search results, if there are any.

@JimSuplizio JimSuplizio added Central-EngSys This issue is owned by the Engineering System team. GitHub Event Processor Anything related to the GitHub Event Processor labels Mar 24, 2023
@JimSuplizio JimSuplizio self-assigned this Mar 24, 2023
@JimSuplizio JimSuplizio requested a review from a team as a code owner March 24, 2023 18:49
{
// https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limits-for-requests-from-github-actions
// When using the GITHUB_TOKEN the number of Actions per hour for an Enterprise repository is 15000/hour
public const int ActionRateLimitEnterprise = 15000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the update you don't use these constants anymore so they could be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were removed with the last commit.

Copy link
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some unused constants but otherwise looks good.

@JimSuplizio JimSuplizio enabled auto-merge (squash) March 24, 2023 19:35
@JimSuplizio JimSuplizio merged commit 02641ce into Azure:main Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team. GitHub Event Processor Anything related to the GitHub Event Processor
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants