取消 区分计划任务
This commit is contained in:
parent
2f8606e5e4
commit
57e9d12b0a
@ -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');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user