W3cubDocs

/CakePHP 4.4

Class ErrorCodeWaitStrategy

Implements retry strategy based on db error codes and wait interval.

Namespace: Cake\Database\Retry

Property Summary

Method Summary

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

Property Detail

$errorCodes protected

Type

array<int>

$retryInterval protected

Type

int

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Database.Retry.ErrorCodeWaitStrategy.html