/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Core/Retry
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Core/Retry/CommandRetry.php (2468B)
strategy = $strategy;
$this->retries = $retries;
}
/**
* The number of retries to perform in case of failure
*
* @param callable $action The callable action to execute with a retry strategy
* @return mixed The return value of the passed action callable
* @throws \Exception
*/
public function run(callable $action)
{
$retryCount = 0;
$lastException = null;
do {
try {
return $action();
} catch (Exception $e) {
$lastException = $e;
if (!$this->strategy->shouldRetry($e, $retryCount)) {
throw $e;
}
}
} while ($this->retries > $retryCount++);
/** @psalm-suppress RedundantCondition */
if ($lastException !== null) {
throw $lastException;
}
}
}