feat: add multiple hooks, pligun schedule support ,add hook:list artisan command

This commit is contained in:
xboard
2025-07-21 13:29:17 +08:00
parent 768e14bdb9
commit c9bab8fb02
16 changed files with 271 additions and 75 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Console;
use App\Services\Plugin\PluginManager;
use App\Utils\CacheKey;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@@ -25,7 +26,7 @@ class Kernel extends ConsoleKernel
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
protected function schedule(Schedule $schedule): void
{
Cache::put(CacheKey::get('SCHEDULE_LAST_CHECK_AT', null), time());
// v2board
@@ -48,7 +49,10 @@ class Kernel extends ConsoleKernel
// 每分钟清理过期的在线状态
$schedule->call(function () {
app(UserOnlineService::class)->cleanExpiredOnlineStatus();
})->everyMinute();
})->everyMinute()->name('cleanup:expired-online-status')->onOneServer();
app(PluginManager::class)->registerPluginSchedules($schedule);
}
/**