Closed oskar-rosen-ui closed 1 year ago
@oskar-rosen-ui RateLimiterUnion
returns object with keyPrefix
limiter option as object key, e.g. { limit1: RateLimiterRes { ... }, limit2: RateLimiterRes {.... } }
. You can get any option like duration
from your configured limiter by that prefix.
@animir thank you for your quick response. That's how I've already implemented it, so I will continue doing so.
@oskar-rosen-ui I think this is the best to keep standard response format for all types of limiters from this package. I am closing this issue. Feel free to reopen if something pops up.
I use
RateLimiterUnion
with two instances ofRateLimiterRedis
and I'm using different fixed windows.When the limit is reached for one of the rate limiters in this union, it would be great it could include the
duration
variable (if it was provided) in theRateLimiterRes
object.