From 57e9d12b0aa04e375ecdd06ba1925aeab2bae427 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Thu, 5 Jan 2023 13:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=20=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Kernel.php | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) 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'); } }