move redis only command to if statement (#1337)

This commit is contained in:
Charles 2025-05-05 16:43:27 -04:00 committed by GitHub
parent a6326f64fb
commit 79691ba663
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,8 +31,11 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
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();