We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa66149 commit 0279f88Copy full SHA for 0279f88
src/Symfony/Component/RateLimiter/CompoundLimiter.php
@@ -37,10 +37,6 @@ public function consume(int $tokens = 1): Limit
37
foreach ($this->limiters as $limiter) {
38
$limit = $limiter->consume($tokens);
39
40
- if (0 === $limit->getRemainingTokens()) {
41
- return $limit;
42
- }
43
-
44
if (null === $minimalLimit || $limit->getRemainingTokens() < $minimalLimit->getRemainingTokens()) {
45
$minimalLimit = $limit;
46
}
src/Symfony/Component/RateLimiter/Limit.php
@@ -43,4 +43,9 @@ public function getRemainingTokens(): int
{
return $this->availableTokens;
+
47
+ public function wait(): void
48
+ {
49
+ sleep(($this->retryAfter->getTimestamp() - time()) * 1e6);
50
+ }
51
0 commit comments