Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[RateLimiter] Fix infinite values with NoLimiter#39911
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| { | ||
| publicfunctionreserve(int$tokens =1, ?float$maxTime =null):Reservation | ||
| { | ||
| returnnewReservation(time(),newRateLimit(\INF,new \DateTimeImmutable(),true, \INF)); |
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.
I am not into the code nor the component, but couldn't we use "-1" like for example done in memory_limit setting in PHP instead of a very large number? 🧐
cc@wouterj
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.
Currently the only use of the remainingTokens and limit properties is for the developer to know how many requests the user can send. This is not used internally in the RateLimiter component.
nicolas-grekas commentedJan 23, 2021
Thank you@YaFou. |
See#39899. I don't find any solution to convert
\INFconstant (which is a float value) to an integer.