取消 区分计划任务

This commit is contained in:
iVampireSP.com 2023-01-05 13:10:08 +08:00
parent 2f8606e5e4
commit 57e9d12b0a
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -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');
}
}