Kernel.php 2.11 KB
<?php

namespace App\Console;

use App\Console\Commands\ActivityStatusRecordCommand;
use App\Console\Commands\BrokerUserConfigCommand;
use App\Console\Commands\GroupOut;
use App\Console\Commands\HttpLogClearCommand;
use App\Console\Commands\NotifyMonitorCommand;
use App\Console\Commands\ProjectOut;
use App\Console\Commands\SyncBusinessDemoCommand;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;

/**
 * @method comment(string $quote)
 */
class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     *
     * @param \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule): void
    {
        $schedule->command('telescope:prune --hours=336')->daily()->onOneServer();
        $schedule->command('queue:prune-batches --hours=72')->daily()->onOneServer();
        $schedule->command(SyncBusinessDemoCommand::class)->everyMinute()->onOneServer();
        $schedule->command(HttpLogClearCommand::class)->withoutOverlapping(60)->lastDayOfMonth('03:00')->onOneServer();
        $schedule->command(GroupOut::class)->everyOddHour()->onOneServer();
        $schedule->command(ProjectOut::class)->everyOddHour()->onOneServer();
        $schedule->command(ActivityStatusRecordCommand::class)->dailyAt('23:55')->onOneServer();
        $schedule->command(NotifyMonitorCommand::class)->withoutOverlapping(5)->everyMinute()->onOneServer();
        $schedule->command(BrokerUserConfigCommand::class, ['singer_num'])->dailyAt('01:00')->onOneServer();
        $schedule->command(BrokerUserConfigCommand::class, ['level_message'])->withoutOverlapping(5)->everyMinute()->onOneServer();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands(): void
    {
        $this->load(__DIR__ . '/Commands');

        Artisan::command('inspire', function () {
            $this->comment(Inspiring::quote());
        })->purpose('Display an inspiring quote');
    }
}