diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 694d816..e4af124 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -26,27 +26,6 @@ class Kernel extends ConsoleKernel * @return void */ protected function schedule(Schedule $schedule): void - { - if (config('settings.node_type') === 'master') { - $this->registerMasterSchedules($schedule); - } else { - $this->registerSlaveSchedules($schedule); - } - } - - /** - * Register the commands for the application. - * - * @return void - */ - protected function commands(): void - { - $this->load(__DIR__ . '/Commands'); - - require base_path('routes/console.php'); - } - - private function registerMasterSchedules(Schedule $schedule): void { // 清理过期的 Token $schedule->command('sanctum:prune-expired --hours=24')->daily(); @@ -84,8 +63,15 @@ private function registerMasterSchedules(Schedule $schedule): void $schedule->job(new SetBirthdayGroupJob())->dailyAt('00:00'); } - private function registerSlaveSchedules(Schedule $schedule): void + /** + * Register the commands for the application. + * + * @return void + */ + protected function commands(): void { + $this->load(__DIR__ . '/Commands'); + require base_path('routes/console.php'); } }