withoutOverlapping on a scheduled command

A scheduled task that occasionally runs longer than its interval will be started again while the first is still going, which for an import means two processes writing the same rows.

$schedule->command('catalogue:import')
         ->hourly()
         ->withoutOverlapping(120)   // minutes before the lock is assumed stale
         ->onOneServer()
         ->runInBackground();

The expiry argument is the part to set deliberately: a process killed while holding the lock leaves it behind, and the default of 24 hours means the job does not run again until tomorrow. onOneServer() is a different problem — it stops two machines running the same schedule — and it needs a shared cache to mean anything, which a per-server file cache is not.