Class ErrorCodeWaitStrategy
Implements retry strategy based on db error codes and wait interval.
Namespace: Cake\Database\Retry
Property Summary
-
$errorCodes protected
array<int>
-
$retryInterval protected
int
Method Summary
-
__construct() public
-
shouldRetry() public
Returns true if the action can be retried, false otherwise.
Method Detail
__construct() ¶ public
__construct(array<int> $errorCodes, int $retryInterval)
Parameters
-
array<int>
$errorCodes DB-specific error codes that allow retrying
-
int
$retryInterval Seconds to wait before allowing next retry, 0 for no wait.
shouldRetry() ¶ public
shouldRetry(Exception $exception, int $retryCount): bool
Returns true if the action can be retried, false otherwise.
Parameters
-
Exception
$exception -
int
$retryCount
Returns
bool