<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    protected function schedule(Schedule $schedule): void
    {
        // This registers the task to check every minute.
        // It is now 100% visible in schedule:list.
        $schedule->command('rss:crawl')->everyMinute()->withoutOverlapping();

        // Standard Queue Worker fallback
        $schedule->command('queue:work --stop-when-empty')->everyMinute()->withoutOverlapping();
    }

    protected function commands(): void
    {
        $this->load(__DIR__.'/Commands');
        require base_path('routes/console.php');
    }
}