-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Add rate limit handling for GitHub client #5226
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Lukas Peter Aldershaab <[email protected]>
Signed-off-by: Lukas Peter Aldershaab <[email protected]>
db27064
to
b56cb64
Compare
For the record, we have tested this out on our setup which runs hundreds of Atlantis jobs simultaneously and it greatly improved our experience |
Sounds like a good idea, @lukaspj is it configurable? |
I can make it configurable for sure, the original PR had discussions on this as well. I’m indifferent towards configuration options because the current default seems very stable for us and we had rate limiting problems constantly before |
server/events/vcs/github_client.go
Outdated
@@ -124,23 +125,28 @@ func NewGithubClient(hostname string, credentials GithubCredentials, config Gith | |||
return nil, errors.Wrap(err, "error initializing github authentication transport") | |||
} | |||
|
|||
transportWithRateLimit, err := github_ratelimit.NewRateLimitWaiterClient(transport.Transport, github_ratelimit.WithTotalSleepLimit(time.Minute, nil)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a callback function passed to report the event of rate limit being exceeded via error log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added one now with a simple warning, what do you think of that one?
Signed-off-by: Lukas Peter Aldershaab <[email protected]>
What response is this waiting on? Anything I need to do? |
This is a recreation of #4926 as that one seems abandoned by the author
What
Why
Implementation
Testing
References
go-github README
go-github-ratelimit library