Skip to content

How to set dynamic point and prefix in service nestjs ? #232

Answered by animir
supryantowp asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @supryantowp
This question is more about what you exactly need. It is fair not only for NestJS.

If you don't need to keep previously consumed points they will be reset after this call this.rateLimits.set(keyPrefix, rateLimiter).
If you need to keep consumed points you can change points of already created limiter on the fly. Just call ateLimiter.points = points.
I hope this answers your question.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@animir
Comment options

Answer selected by supryantowp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants