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
Block duration option for throttler #1668
base: master
Are you sure you want to change the base?
Conversation
From a quick pass it looks pretty good, I'll need to go more in depth later. One main concern of mine is that this will be a breaking change at the library level, so anyone who maintains a storage package will need to update to the new interface. Is there any way to keep the current API, or is hat not possible with the nature of the changes? |
Yes. This will be a breaking change at the library level. I think it's not possible to keep the current API. |
@jmcdo29 This would be nice to have |
@asif-jalil I look forward to this feature |
@cdx111 I also look forward to this feature. But I don't know why @jmcdo29 pushed this to a long waiting list! |
Apologies for the delay and thank you for your patience. It's been hectic keeping up with support and general life. I wanna revisit this and see what can be done with it, as I can tell there is a community want for this. |
@jmcdo29 is there any update? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right! Finally got around to reviewing this. Overall everything looks good, there's a few changes I think I'll want to make as we're already going to be making breaking changes, so it'll be a good time to do so. I also want to get @kkoomen to take a look so he's aware of the changes that will need to be made for the redis storage for this update, but otherwise this looks good, and I'd be willing to release it soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, cool, code looks great. I'll let CI run, and wait for @kkoomen to weigh in as well
@jmcdo29 Sorry for my late reply, I'm very busy lately. I only have some minor requests in terms of docblock things. I'm not too much involved in the project but it looks fine to me for what I see. I also noticed the Other than that, I don't think I need to make any adjustments to my redis storage, if so, someone will probably run into an issue and submit an issue :P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still some remaining typos and a console.log to be removed.
@jmcdo29 Looking good from my side. Up to you to merge whenever you feel like. |
@jmcdo29 is there any update for merge? |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently, when a user exceeds their request limit within a defined time window (
ttl
), their requests are blocked for a fixed duration tied to thettl
.Issue Number: 1660
What is the new behavior?
I introduced a new option called
blockDuration
when importing the throttler module option. If users choose not to specifyblockDuration
, the system will fall back to the default behavior, which relies on the ttl.Does this PR introduce a breaking change?
Other information