From 683c24378f3c93dbf5026bdc36abdb260de2ad70 Mon Sep 17 00:00:00 2001 From: Kovah Date: Thu, 30 Jan 2025 13:32:08 +0100 Subject: [PATCH] Stop queue runner if there are no jobs --- app/Console/Kernel.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index ad33908a..6ad1f7ce 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -9,7 +9,11 @@ class Kernel extends ConsoleKernel { protected function schedule(Schedule $schedule): void { - $schedule->command('queue:work --queue=default,import --max-jobs=30')->withoutOverlapping(); + $schedule->command('queue:work', [ + '--queue' => 'default,import', + '--max-jobs' => '30', + '--stop-when-empty', + ])->withoutOverlapping(); $schedule->command('links:check')->everyTwoHours()->withoutOverlapping();