Kernel.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace App\Console;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  5. class Kernel extends ConsoleKernel
  6. {
  7. /**
  8. * The Artisan commands provided by your application.
  9. *
  10. * @var array
  11. */
  12. protected $commands = [
  13. //
  14. ];
  15. /**
  16. * Define the application's command schedule.
  17. *
  18. *
  19. * @return void
  20. */
  21. protected function schedule(Schedule $schedule)
  22. {
  23. $schedule->command('media:optimize')->hourlyAt(40)->onOneServer();
  24. $schedule->command('media:gc')->hourlyAt(5)->onOneServer();
  25. $schedule->command('horizon:snapshot')->everyFiveMinutes()->onOneServer();
  26. $schedule->command('story:gc')->everyFiveMinutes()->onOneServer();
  27. $schedule->command('gc:failedjobs')->dailyAt(3)->onOneServer();
  28. $schedule->command('gc:passwordreset')->dailyAt('09:41')->onOneServer();
  29. $schedule->command('gc:sessions')->twiceDaily(13, 23)->onOneServer();
  30. $schedule->command('app:weekly-instance-scan')->weeklyOn(2, '4:20')->onOneServer();
  31. if ((bool) config_cache('pixelfed.cloud_storage') && (bool) config_cache('media.delete_local_after_cloud')) {
  32. $schedule->command('media:s3gc')->hourlyAt(15);
  33. }
  34. if (config('import.instagram.enabled')) {
  35. $schedule->command('app:transform-imports')->everyTenMinutes()->onOneServer();
  36. $schedule->command('app:import-upload-garbage-collection')->hourlyAt(51)->onOneServer();
  37. $schedule->command('app:import-remove-deleted-accounts')->hourlyAt(37)->onOneServer();
  38. $schedule->command('app:import-upload-clean-storage')->twiceDailyAt(1, 13, 32)->onOneServer();
  39. if (config('import.instagram.storage.cloud.enabled') && (bool) config_cache('pixelfed.cloud_storage')) {
  40. $schedule->command('app:import-upload-media-to-cloud-storage')->hourlyAt(39)->onOneServer();
  41. }
  42. }
  43. $schedule->command('app:notification-epoch-update')->weeklyOn(1, '2:21')->onOneServer();
  44. $schedule->command('app:hashtag-cached-count-update')->hourlyAt(25)->onOneServer();
  45. $schedule->command('app:account-post-count-stat-update')->everySixHours(25)->onOneServer();
  46. $schedule->command('app:instance-update-total-local-posts')->twiceDailyAt(1, 13, 45)->onOneServer();
  47. }
  48. /**
  49. * Register the commands for the application.
  50. *
  51. * @return void
  52. */
  53. protected function commands()
  54. {
  55. $this->load(__DIR__.'/Commands');
  56. require base_path('routes/console.php');
  57. }
  58. }