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