From 3bb2b0b81fa4482675480d3fe343a360382c75bb Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 10 Jul 2025 12:11:22 +0200 Subject: [PATCH] upgrade task schedule --- app/Console/Kernel.php | 51 +++++++++++++++--------------------------- routes/console.php | 36 ++++++++++++++++++++++++----- 2 files changed, 49 insertions(+), 38 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 88fdf9a..cd69f65 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -7,39 +7,24 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { - /** - * Define the application's command schedule. - * - * @param \Illuminate\Console\Scheduling\Schedule $schedule - * @return void - */ - protected function schedule(Schedule $schedule) - { - $schedule->command('twitch:channel-info')->everyFiveMinutes(); - $schedule->command('sync:stepladder')->daily(); - $schedule->command('sync:speedgaming')->everyFiveMinutes(); - $schedule->command('sync:cabookey')->everyFiveMinutes(); - $schedule->command('sync:coop-zossy')->everyFiveMinutes(); - $schedule->command('sync:enemizer')->everyFiveMinutes(); - $schedule->command('sync:hth')->everyFiveMinutes(); - $schedule->command('sync:sra')->everyFifteenMinutes(); - $schedule->command('sync:zsr')->everyFifteenMinutes(); - $schedule->command('sync:avatars')->everyFiveMinutes(); - $schedule->command('sync:racetime')->everyFiveMinutes(); - $schedule->command('discord:episode-subscriptions')->everyMinute(); - $schedule->command('chat:evaluate 100')->everyMinute(); - $schedule->command('guessing:clean')->everyFifteenMinutes(); - } + /** + * Define the application's command schedule. + * + * @param \Illuminate\Console\Scheduling\Schedule $schedule + * @return void + */ + protected function schedule(Schedule $schedule): void { + // + } - /** - * Register the commands for the application. - * - * @return void - */ - protected function commands() - { - $this->load(__DIR__.'/Commands'); + /** + * Register the commands for the application. + * + * @return void + */ + protected function commands(): void { + $this->load(__DIR__.'/Commands'); - require base_path('routes/console.php'); - } + require base_path('routes/console.php'); + } } diff --git a/routes/console.php b/routes/console.php index e05f4c9..e603edd 100644 --- a/routes/console.php +++ b/routes/console.php @@ -1,7 +1,6 @@ comment(Inspiring::quote()); -})->purpose('Display an inspiring quote'); +Schedule::command('twitch:channel-info')->everyFiveMinutes()->runInBackground(); + +Schedule::command('sync:stepladder')->daily()->runInBackground(); + +Schedule::everyFiveMinutes() + ->runInBackground() + ->group(function () { + Schedule::command('sync:speedgaming'); + Schedule::command('sync:cabookey'); + Schedule::command('sync:coop-zossy'); + Schedule::command('sync:enemizer'); + Schedule::command('sync:hth'); + Schedule::command('sync:nmg-league'); + }); + +Schedule::everyFifteenMinutes() + ->runInBackground() + ->group(function () { + Schedule::command('sync:sra'); + Schedule::command('sync:zsr'); + }); + +Schedule::command('sync:avatars')->everyFiveMinutes()->runInBackground(); +Schedule::command('sync:racetime')->everyFiveMinutes()->runInBackground(); + +Schedule::command('discord:episode-subscriptions')->everyMinute(); + +Schedule::command('chat:evaluate 100')->everyMinute()->runInBackground(); + +Schedule::command('guessing:clean')->everyFifteenMinutes(); -- 2.39.5