refactor(online-status): consolidate updates and add cleanup command

This commit is contained in:
xboard
2025-09-15 20:32:22 +08:00
parent cd8a8ecf58
commit 843c5af4c2
5 changed files with 163 additions and 74 deletions
+1 -4
View File
@@ -46,10 +46,7 @@ class Kernel extends ConsoleKernel
// if (env('ENABLE_AUTO_BACKUP_AND_UPDATE', false)) {
// $schedule->command('backup:database', ['true'])->daily()->onOneServer();
// }
// 每分钟清理过期的在线状态
$schedule->call(function () {
app(UserOnlineService::class)->cleanExpiredOnlineStatus();
})->everyMinute()->name('cleanup:expired-online-status')->onOneServer();
$schedule->command('cleanup:expired-online-status')->everyMinute()->onOneServer()->withoutOverlapping(4);
app(PluginManager::class)->registerPluginSchedules($schedule);