Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug][RateLimiter] sleep/usleep typo #40656

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

Closed
sirian opened this issue Mar 31, 2021 · 1 comment
Closed

[Bug][RateLimiter] sleep/usleep typo #40656

sirian opened this issue Mar 31, 2021 · 1 comment

Comments

@sirian
Copy link
Contributor

sirian commented Mar 31, 2021

Symfony version(s) affected: 5.x

Description
https://github.com/symfony/rate-limiter/blob/5.x/RateLimit.php#L70

Probably a typo and there should be usleep? (or remove 1e6 )

    public function wait(): void
    {
        sleep(($this->retryAfter->getTimestamp() - time()) * 1e6);
    }
@Nyholm
Copy link
Member

Nyholm commented Mar 31, 2021

Great. Thank you for this issue.

There is a patch at #40658 that will resolve this.

nicolas-grekas added a commit that referenced this issue Apr 1, 2021
This PR was merged into the 5.2 branch.

Discussion
----------

[RateLimiter] Fix sleep value

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40656
| License       | MIT
| Doc PR        |

sleep vs usleep

Commits
-------

cf66399 Fix sleep value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants