Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
nicolas-grekas merged 1 commit intosymfony:5.2fromYaFou:no-limiter-infinity
Jan 23, 2021

Conversation

@YaFou
Copy link
Contributor

QA
Branch?5.2
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#39899
LicenseMIT
Doc PRsymfony/symfony-docs#...

See#39899. I don't find any solution to convert\INF constant (which is a float value) to an integer.

{
publicfunctionreserve(int$tokens =1, ?float$maxTime =null):Reservation
{
returnnewReservation(time(),newRateLimit(\INF,new \DateTimeImmutable(),true, \INF));
Copy link
Contributor

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

Copy link
ContributorAuthor

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.

OskarStark reacted with thumbs up emoji
@nicolas-grekas
Copy link
Member

Thank you@YaFou.

@nicolas-grekasnicolas-grekas merged commit3fedac0 intosymfony:5.2Jan 23, 2021
@fabpotfabpot mentioned this pull requestJan 27, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

4 participants

@YaFou@nicolas-grekas@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp