mvenghaus / laravel-retry-on-deadlock
A simple function to retry a callback if a deadlock occurs.
1.0.1
2024-11-04 06:10 UTC
Requires
- php: ^8.1
- laravel/framework: *
README
A simple function to retry a callback if a deadlock occurs.
Installation
Install the package via composer:
composer require mvenghaus/laravel-retry-on-deadlock
Definition
function retryOnDeadlock(callable $callback, int $times = 10, int $sleepMilliseconds = 1000)
Usage
After installation, you can use the function immediately as it is automatically loaded via composer.
retryOnDeadlock(function() { // do database stuff });