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

This package is auto-updated.

Last update: 2024-11-04 06:10:35 UTC


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
});