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

Option to throttle the action #86

Open
bryangingechen opened this issue Sep 23, 2022 · 4 comments
Open

Option to throttle the action #86

bryangingechen opened this issue Sep 23, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@bryangingechen
Copy link

Hi, thanks for this very convenient action! We've been using it for a while at https://github.com/leanprover-community/mathlib (see here), but recently the action has been failing on every run with the error:

Error: GraphqlError: API rate limit exceeded for user ID XXXX.
Error: API rate limit exceeded for user ID XXXX.

I suspect this is because we have a large number of open PRs (565 at the moment, but we're steadily approaching 600) and the action is making a large number of API calls in a short period of time.

Would it be possible to add an option to throttle the rate of calls somehow so that we can keep using your action? Thanks!

@eps1lon
Copy link
Owner

eps1lon commented Sep 23, 2022

I suspect that's very hard to do since that would introduce statefulnes into the action. Have you checked if there are existing patterns that can throttle entire runs instead if single actions?

@bryangingechen
Copy link
Author

I hadn't. I might be misunderstanding your suggestion, but our workflow only runs this one action once every 15 minutes (and we're even using a GitHub token from an account dedicated to this workflow, so that our other workflows don't contribute to the API limit).

What sort of thing did you have in mind?

@eps1lon
Copy link
Owner

eps1lon commented Oct 8, 2022

If you already throttle the action what would be achieved if the action itself throttles? I don't see how the action could throttle that couldn't be achieved at the workflow level.

The only implementation I can see for throttling at the action level would involve adding statefulness i.e. each action call needs to be aware of the previous calls. I wouldn't know where to begin with implementations. If you have a concrete implementation in form of a PR I can take a look.

@eps1lon eps1lon added the enhancement New feature or request label Oct 8, 2022
@bryangingechen
Copy link
Author

Hmm, perhaps I wasn't being clear. What I had in mind was more along the lines of adding a (user-specified?) pause after each iteration of this for loop. That way the GitHub API calls can be spread out and we can hopefully avoid getting rate limited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants