-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allowfor multiple throttler contexts
This is a bit of something that I've wanted to do for a while and inspired by [this pr][pr]. With the new appraoch, we're now able to let users define scales at which they would like the throttling to work over, and let it work for any number of configuratins, from a single 10 requests in 5 seconds to scales of months, or milliseconds BREAKING CHANGES: It's worth noting there are quite a few breaking changes in this which will be reflected in the changelog as well, but better to have multiple mentions in my opinion * ttl is now in milliseconds, not seconds, but there are time helper exposed to ease the migration to that * the module options is now either an array or an object with a `throttlers` array property * `@Throttle()` now takes in an object instead of two parameters, to allow for setting multiple throttle contexts at once in a more readable manner * `@ThrottleSkip()` now takes in an object with string boolean to say which throttler should be skipped pr: #1522 ref: #1369 ref: #1522
- Loading branch information
Showing
17 changed files
with
422 additions
and
81 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Oops, something went wrong.