Add Support for custom delay time during rate limiting #10
discoverlance-com
started this conversation in
Ideas
Replies: 1 comment 7 replies
-
Sorry, just seeing this now. There's some good ideas here. I just made some changes to the rate limiters over the past few days, so now it's prime for even more changes lol. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for this package. It's very good for simple functions rate limiting which I am testing.
I think when it comes to the rate limiting, I see that the
msUntilNextWindow
depends on the window you set. This can be less useful in some situations such as when I want to rate limit the user for say, 10 function calls per minute. It means that they have to wait for 1 minute after failing the attempts or reaching the limit which does not make for a good experience in some situations like calling a sign in function.If possible, let us supply a custom delay/decay time like
The delay can be optional where by default, it uses the window but can also use the delay/decay:
I could submit an issue/pull request for this change but it looks like a core api change so I wanted to open this discussion first to get your ideas on the topic.
I guess my suggestion also defeats the purpose of rate limiting as it's per window.... so till the next window is available, the request should not be valid. Do you have any other suggestions though in such a case? I think the other option is to reduce the window and possibly align the attempts to that window.
Beta Was this translation helpful? Give feedback.
All reactions