From 79691ba663dfd26c18519ab0f9f0e4515e5281a3 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 5 May 2025 16:43:27 -0400 Subject: [PATCH] move redis only command to if statement (#1337) --- app/Console/Kernel.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 7545f177e..9e52a5b81 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -31,8 +31,11 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule): void { - // https://laravel.com/docs/10.x/upgrade#redis-cache-tags - $schedule->command('cache:prune-stale-tags')->hourly(); + if (config('cache.default') === 'redis') { + // https://laravel.com/docs/10.x/upgrade#redis-cache-tags + // This only needs to run when using redis. anything else throws an error. + $schedule->command('cache:prune-stale-tags')->hourly(); + } // Execute scheduled commands for servers every minute, as if there was a normal cron running. $schedule->command(ProcessRunnableCommand::class)->everyMinute()->withoutOverlapping();