Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise Documentation #264

Closed
jeremykentbgross opened this issue Apr 30, 2024 · 2 comments
Closed

Revise Documentation #264

jeremykentbgross opened this issue Apr 30, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jeremykentbgross
Copy link

I don't know if it is just me, but I found the documentation for blockduration to be very unclear as written at: https://github.com/animir/node-rate-limiter-flexible/wiki/Options#blockduration

From experimentation I would say that duration is mostly clear, but could be improved from:

Number of seconds before consumed points are reset.

To something like:

Number of seconds before consumed points are reset, starting from the time of the first consumed point on a key. (ie: How long to remember points for a key after the first consumption of/on it.)

But mainly I would consider revising blockduration to say something like:

While duration will cause the points to be remembered for the given interval after the first consumption of a key, and block when all points are consumed until it is reset after an interval given by the duration, blockduration will cause the reset to happen sooner once a key is actually blocked.

Maybe these suggested changes are not perfect, ideal or even suitable either, but I found myself confused by the docs as written, and it was only by modifying a working version of the example at https://github.com/animir/node-rate-limiter-flexible/wiki/Overall-example#login-endpoint-protection to have much shorter duration and blockduration that I was able to deduce what they were really doing. I figured that if I had some trouble with this, then others might also, so I would leave behind a note about it, and make a suggestion for improvement.

@animir
Copy link
Owner

animir commented May 5, 2024

@jeremykentbgross I improved the description based on your feedback. Could you check if it is clear now? Thank you!

@animir animir added the enhancement New feature or request label May 5, 2024
@animir animir closed this as completed May 19, 2024
@jeremykentbgross
Copy link
Author

My apologies for not replying 2 weeks ago. I only now saw the notifications last night in my inbox with it being marked complete. Looking at it now it seems clear, but I would need to refresh my memory with some tests to be sure I am not mistaken. I trust your judgement on the correction though, as it seems much clearer than before and I am sure you understand the internal functionality better than I do in terms of it being an accurate description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants