Repository navigation
Make rate-limiting configurable - #907
Merged
Merged
Conversation
Contributor
Author
|
Questions for reviewers:
|
kfcampbell
marked this pull request as ready for review
September 22, 2021 04:55
jcudit
approved these changes
Sep 28, 2021
jcudit
left a comment
Contributor
There was a problem hiding this comment.
This is on the right track. Added some cosmetic suggestions but likely to ship in the upcoming release.
Co-authored-by: Jeremy Udit <[email protected]>
Co-authored-by: Jeremy Udit <[email protected]>
Co-authored-by: Jeremy Udit <[email protected]>
jcudit
approved these changes
Oct 5, 2021
jcudit
left a comment
Contributor
There was a problem hiding this comment.
Excited to see this one land, thanks!
kfcampbell
added a commit
to kfcampbell/terraform-provider-github
that referenced
this pull request
Jul 26, 2022
* Make struct type public * Scaffold functional pattern for providing writeDelay * Add WriteDelay to config and plumb it down * Add configuration for write delay * Validate writeDelay is positive * Add website description of write_delay argument * Use convenience func to pass writeDelay into rate limiter * Move convenience func closer to implementation; add convenience type * Rename write_delay --> write_delay_ms * Update github/provider.go Co-authored-by: Jeremy Udit <[email protected]> * Describe default for write_delay_ms in help text * Update github/transport.go Co-authored-by: Jeremy Udit <[email protected]> * Update website/docs/index.html.markdown Co-authored-by: Jeremy Udit <[email protected]> Co-authored-by: Jeremy Udit <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #845.
This PR provides a configurable delay to sleep between writes for our rate-limiting construct. Inspired by our very talented coworker Dave Cheney's "Functional options for friendly APIs" blog post. The default is the same as before, which is sleeping 1000ms between write operations.
Example terraform:
Example log output showing new sleeping times:
Example error output when a negative value is given:

Example error output when a string is given:

Example error output when a cartoonishly large number (9999999999999999999999) is given:

@kfcampbell's TODO list:
Some things that need to be addressed before making ready for review:
transport_test.gotests don't test any of the behavior with write delays