Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
56 | 27 | public function retry(InternalRequestInterface $internalRequest, $wait = true) |
|
57 | { |
||
58 | 27 | if (!$this->strategy->verify($internalRequest)) { |
|
59 | 9 | return false; |
|
60 | } |
||
61 | |||
62 | 18 | if ($wait && ($delay = $this->strategy->delay($internalRequest)) > 0) { |
|
63 | 9 | usleep($delay * 1000000); |
|
64 | 7 | } |
|
65 | |||
66 | 18 | return $internalRequest->withParameter( |
|
67 | 18 | self::RETRY_COUNT, |
|
68 | 18 | $internalRequest->getParameter(self::RETRY_COUNT) + 1 |
|
69 | 14 | ); |
|
70 | } |
||
71 | } |
||
72 |