From dc6b9f466103be4c1a4218a7217c316e2cd02687 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 31 May 2024 02:56:13 -0600 Subject: [PATCH] Update task scheduler, add weekly instance scan to check nodeinfo for known instances --- app/Console/Commands/WeeklyInstanceScan.php | 47 +++++++++++++++++++++ app/Console/Kernel.php | 4 +- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 app/Console/Commands/WeeklyInstanceScan.php diff --git a/app/Console/Commands/WeeklyInstanceScan.php b/app/Console/Commands/WeeklyInstanceScan.php new file mode 100644 index 000000000..a2560c254 --- /dev/null +++ b/app/Console/Commands/WeeklyInstanceScan.php @@ -0,0 +1,47 @@ + $this->updateInstanceStats($instance), + ); + } + + protected function updateInstanceStats($instance) + { + FetchNodeinfoPipeline::dispatch($instance)->onQueue('intbg'); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 938696a1d..37f9d20b3 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -19,7 +19,6 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule * * @return void */ @@ -32,6 +31,7 @@ class Kernel extends ConsoleKernel $schedule->command('gc:failedjobs')->dailyAt(3)->onOneServer(); $schedule->command('gc:passwordreset')->dailyAt('09:41')->onOneServer(); $schedule->command('gc:sessions')->twiceDaily(13, 23)->onOneServer(); + $schedule->command('app:weekly-instance-scan')->weeklyOn(2, '4:20')->onOneServer(); if ((bool) config_cache('pixelfed.cloud_storage') && (bool) config_cache('media.delete_local_after_cloud')) { $schedule->command('media:s3gc')->hourlyAt(15); @@ -60,7 +60,7 @@ class Kernel extends ConsoleKernel */ protected function commands() { - $this->load(__DIR__ . '/Commands'); + $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); }