- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Send log on first rate-limited request #16
Comments
We would have to create some logic that determines that this is the first time we limit this user, that being said we need to store it somewhere, when using memorystore its easy to do but redis / upstash it equals more storage so that's going to cost more. |
Would this be a good thing to implement maybe even only for memory store or you don't like the idea to have different APIs? |
I could probably add |
That would be awesome! |
If you are thinking to add it, do you have an estimation of when it could be added? |
Yep sorry about that, its not that its hard to implement it's literally a few lines however i work full time i cant lose any work day based on the current status, therefore i don't really get the chance to open the computer considering that i go gym and see my girlfriend once i finished work. If you make a pr, i will make sure to review and merge it asap |
I was looking to implement it, but I'm slightly confused about where you would like to have it. You would add a new property in the MemoryStore and then pass it to the onLimit through the hitInfo variable in the @core package? |
HitInfo can be anything not just a number, anyways hitinfo shouldn't be a factor here it should indeed be a new property within the memorystore |
I wanted to send an information to my logger service when someone would get rate-limited (I'm using the memory store), but if I send the log in the
onLimit
function, I would get flooded with a lot of logs (and this make sense because the onLimit function is called on each request).Would there be an option to have a function that is called only on the first request where the user (with the same fingerprint) is being rate limited?
If there is no option at the moment, I think this would be a feature request
Thanks for the amazing library btw!
The text was updated successfully, but these errors were encountered: