| @@ 186-193 (lines=8) @@ | ||
| 183 | /** |
|
| 184 | * @inheritdoc |
|
| 185 | */ |
|
| 186 | public function getRetryTimeout() |
|
| 187 | { |
|
| 188 | if ($this->threshold > $this->count() + 1) { |
|
| 189 | return 0; |
|
| 190 | } |
|
| 191 | ||
| 192 | return (int) ceil($this->timeLimit / $this->tokenlimit); |
|
| 193 | } |
|
| 194 | ||
| 195 | /** |
|
| 196 | * @param int $tokenCount |
|
| @@ 200-207 (lines=8) @@ | ||
| 197 | * |
|
| 198 | * @return int |
|
| 199 | */ |
|
| 200 | private function getWaitTime($tokenCount) |
|
| 201 | { |
|
| 202 | if ($this->threshold > $tokenCount) { |
|
| 203 | return 0; |
|
| 204 | } |
|
| 205 | ||
| 206 | return (int) ceil($this->timeLimit / max(1, ($this->tokenlimit - $this->threshold))); |
|
| 207 | } |
|
| 208 | ||
| 209 | /** |
|
| 210 | * @param int $tokens |
|