-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Add support to enable backoff when rate limited by the Github API #7192
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
|
Thank you for your contribution! 🙏 Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected. While you are waiting, make sure to:
Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient. Learn more about our contribution guide. |
pkg/scalers/github_runner_scaler.go
Outdated
| if retryAfterStr := header.Get("Retry-After"); retryAfterStr != "" { | ||
| retrySeconds, err := strconv.Atoi(retryAfterStr) | ||
| if err != nil { | ||
| return RateLimit{}, fmt.Errorf("failed to parse Retry-After header. Returned error: %s", err.Error()) |
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.
Semgrep found a possible error wrong wrapped.
🥳 Fixed in commit 9e21288 🥳
pkg/scalers/github_runner_scaler.go
Outdated
| resetStr := header.Get("X-RateLimit-Reset") | ||
| reset, err := strconv.ParseInt(resetStr, 10, 64) | ||
| if err != nil { | ||
| return RateLimit{}, fmt.Errorf("failed to parse X-RateLimit-Reset header. Returned error: %s", err.Error()) |
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.
Semgrep found a possible error wrong wrapped.
🥳 Fixed in commit 9e21288 🥳
pkg/scalers/github_runner_scaler.go
Outdated
| remainingStr := header.Get("X-RateLimit-Remaining") | ||
| remaining, err := strconv.Atoi(remainingStr) | ||
| if err != nil { | ||
| return RateLimit{}, fmt.Errorf("failed to parse X-RateLimit-Remaining header. Returned error: %s", err.Error()) |
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.
Semgrep found a possible error wrong wrapped.
🍰 Fixed in commit 9e21288 🍰
Signed-off-by: andrewhibbert <[email protected]>
Signed-off-by: andrewhibbert <[email protected]>
Adds support to backoff when a rate limit error occurs as per handle rate limit errors appropriately:
Fixes #6643
Relates to kedacore/keda-docs#1557