Why consume continue accumulating points after the block? #344
Unanswered
00christian00
asked this question in
Q&A
Replies: 2 comments 3 replies
-
|
@00christian00 Hey. Interesting observation.
Firstly, it will never consume points if key is blocked already. Preliminar |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
I already modified it, now I tried to revert to it and I get the correct value. Either I was checking the wrong variable or I did something that I cannot remember. Now it is working as expected.... |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hello,
I read the documentation many times and never understood why the login protection example was so complex compared to the base rate limiting example and today I finally realized.
Why does the "consume" method continue accumulating points and resetting the block duration?
Wouldn't be simpler if we could just rely on the consume error to simply check if we run out of points like we do in the base example?
What scenario benefits from having to validate the points before consuming? Seem redundant to me, but maybe I am missing something.
The docs says "The example can be simplified if replace two get requests in the beginning to two consume calls, but there are concerns. First, consume calls are more expensive".
Which seems that it is supposed to work, but in reality the result seems to be much different as the block seem to be restarted every time we consume.
Beta Was this translation helpful? Give feedback.
All reactions