Add queue worker setting so those aren't run in cron if there's a worker
This commit is contained in:
@@ -26,9 +26,12 @@ class Kernel extends ConsoleKernel
|
|||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule): void
|
protected function schedule(Schedule $schedule): void
|
||||||
{
|
{
|
||||||
$schedule->command(JobQueue::class)
|
// If not using the queue worker then run those via cron
|
||||||
->everyMinute()
|
if (!config('queue.worker', false)) {
|
||||||
->withoutOverlapping();
|
$schedule->command(JobQueue::class)
|
||||||
|
->everyMinute()
|
||||||
|
->withoutOverlapping();
|
||||||
|
}
|
||||||
|
|
||||||
$schedule->command(Nightly::class)->dailyAt('01:00');
|
$schedule->command(Nightly::class)->dailyAt('01:00');
|
||||||
$schedule->command(Weekly::class)->weeklyOn(0);
|
$schedule->command(Weekly::class)->weeklyOn(0);
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ return [
|
|||||||
|
|
||||||
'default' => env('QUEUE_DRIVER', 'sync'),
|
'default' => env('QUEUE_DRIVER', 'sync'),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If you're using the queue worker, then disable running queued tasks via cron
|
||||||
|
*/
|
||||||
|
'worker' => env('QUEUE_WORKER', false),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Queue Connections
|
| Queue Connections
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ LOG_LEVEL=debug
|
|||||||
APP_DEBUG=$APP_DEBUG$
|
APP_DEBUG=$APP_DEBUG$
|
||||||
DEBUG_TOOLBAR=$DEBUG_TOOLBAR$
|
DEBUG_TOOLBAR=$DEBUG_TOOLBAR$
|
||||||
|
|
||||||
# DATABASE SETTINGS
|
## DATABASE SETTINGS
|
||||||
|
|
||||||
DB_CONNECTION=$DB_CONNECTION$
|
DB_CONNECTION=$DB_CONNECTION$
|
||||||
DB_HOST='$DB_HOST$'
|
DB_HOST='$DB_HOST$'
|
||||||
DB_PORT=$DB_PORT$
|
DB_PORT=$DB_PORT$
|
||||||
@@ -33,18 +34,19 @@ DB_PREFIX='$DB_PREFIX$'
|
|||||||
DB_EMULATE_PREPARES=$DB_EMULATE_PREPARES$
|
DB_EMULATE_PREPARES=$DB_EMULATE_PREPARES$
|
||||||
DB_SOCKET=
|
DB_SOCKET=
|
||||||
|
|
||||||
# CACHE SETTINGS
|
## CACHE SETTINGS
|
||||||
|
# https://docs.phpvms.net/config/optimizing#caching
|
||||||
|
|
||||||
CACHE_DRIVER=$CACHE_DRIVER$
|
CACHE_DRIVER=$CACHE_DRIVER$
|
||||||
CACHE_PREFIX='$CACHE_PREFIX$'
|
CACHE_PREFIX='$CACHE_PREFIX$'
|
||||||
|
|
||||||
# QUEUE SETTINGS
|
## EMAIL SETTINGS
|
||||||
# Set this to "database" if you have slow pages due to notifications/emails
|
|
||||||
# They will then be sent out via cron
|
|
||||||
QUEUE_DRIVER=sync
|
|
||||||
|
|
||||||
# EMAIL SETTINGS
|
|
||||||
# Look at the available mail configs in config/mail.php
|
# Look at the available mail configs in config/mail.php
|
||||||
# Also refer to the Laravel docs here: https://laravel.com/docs/8.x/mail
|
# Also refer to the Laravel docs here: https://laravel.com/docs/8.x/mail
|
||||||
|
# If you're using SMTP, I recommend setting the QUEUE_DRIVER to 'database'
|
||||||
|
# https://docs.phpvms.net/config/optimizing#queue-driver
|
||||||
|
|
||||||
MAIL_DRIVER=$MAIL_DRIVER$
|
MAIL_DRIVER=$MAIL_DRIVER$
|
||||||
MAIL_FROM_NAME='$MAIL_FROM_NAME$'
|
MAIL_FROM_NAME='$MAIL_FROM_NAME$'
|
||||||
MAIL_FROM_ADDRESS='$MAIL_FROM_ADDRESS$'
|
MAIL_FROM_ADDRESS='$MAIL_FROM_ADDRESS$'
|
||||||
@@ -53,3 +55,14 @@ MAIL_PORT=$MAIL_PORT$
|
|||||||
MAIL_ENCRYPTION=$MAIL_ENCRYPTION$
|
MAIL_ENCRYPTION=$MAIL_ENCRYPTION$
|
||||||
MAIL_USERNAME=$MAIL_USERNAME$
|
MAIL_USERNAME=$MAIL_USERNAME$
|
||||||
MAIL_PASSWORD=$MAIL_PASSWORD$
|
MAIL_PASSWORD=$MAIL_PASSWORD$
|
||||||
|
|
||||||
|
## QUEUE SETTINGS
|
||||||
|
|
||||||
|
# Set this to "database" if you have slow pages due to notifications/emails
|
||||||
|
# They will then be sent out via cron
|
||||||
|
QUEUE_DRIVER=sync
|
||||||
|
|
||||||
|
# If you're using the Laravel Queue Worker, set this to true. This will stop the queue tasks
|
||||||
|
# from being run during the cron job
|
||||||
|
# https://laravel.com/docs/8.x/queues#running-the-queue-worker
|
||||||
|
QUEUE_WORKER=false
|
||||||
|
|||||||
Reference in New Issue
Block a user