Mutex for Laravel Console Commands.
arvenil/ninja-mutex
, and support MySQL PDO options for mysql
lock strategy (thanks, @rafacouto );⚠️ If you're using $mutexStrategy
and/or $mutexTimeout
fields, your IDE might ask you to add proper types (string
and/or ?int
):
class ExampleCommand extends Command
{
use WithoutOverlapping;
protected string $mutexStrategy = 'mysql';
protected ?int $mutexTimeout = 3000;
// ...
}
The null
should be set explicitly, if used:
class ExampleCommand extends Command
{
use WithoutOverlapping;
protected ?int $mutexTimeout = null;
// ...
}