Add queue worker setting so those aren't run in cron if there's a worker

This commit is contained in:
Nabeel Shahzad
2021-05-21 12:31:32 -04:00
parent d3ec0f4de3
commit c94358350a
3 changed files with 31 additions and 10 deletions

View File

@@ -26,9 +26,12 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
$schedule->command(JobQueue::class)
->everyMinute()
->withoutOverlapping();
// If not using the queue worker then run those via cron
if (!config('queue.worker', false)) {
$schedule->command(JobQueue::class)
->everyMinute()
->withoutOverlapping();
}
$schedule->command(Nightly::class)->dailyAt('01:00');
$schedule->command(Weekly::class)->weeklyOn(0);