errorCodes = $errorCodes; $this->retryInterval = $retryInterval; } /** * @inheritDoc */ public function shouldRetry(Exception $exception, int $retryCount): bool { if ( $exception instanceof PDOException && $exception->errorInfo && in_array($exception->errorInfo[1], $this->errorCodes) ) { if ($this->retryInterval > 0) { sleep($this->retryInterval); } return true; } return false; } }