Kernel.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  19. *
  20. * @return void
  21. */
  22. protected function schedule(Schedule $schedule)
  23. {
  24. $schedule->command('media:optimize')->hourlyAt(40);
  25. $schedule->command('media:gc')->hourlyAt(5);
  26. $schedule->command('horizon:snapshot')->everyFiveMinutes();
  27. $schedule->command('story:gc')->everyFiveMinutes();
  28. $schedule->command('gc:failedjobs')->dailyAt(3);
  29. $schedule->command('gc:passwordreset')->dailyAt('09:41');
  30. $schedule->command('gc:sessions')->twiceDaily(13, 23);
  31. if(in_array(config_cache('pixelfed.cloud_storage'), ['1', true, 'true']) && config('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')->everyFourMinutes();
  36. $schedule->command('app:import-upload-garbage-collection')->hourlyAt(51);
  37. $schedule->command('app:import-remove-deleted-accounts')->hourlyAt(37);
  38. $schedule->command('app:import-upload-clean-storage')->twiceDailyAt(1, 13, 32);
  39. }
  40. $schedule->command('app:notification-epoch-update')->weeklyOn(1, '2:21');
  41. $schedule->command('app:hashtag-cached-count-update')->hourlyAt(25);
  42. }
  43. /**
  44. * Register the commands for the application.
  45. *
  46. * @return void
  47. */
  48. protected function commands()
  49. {
  50. $this->load(__DIR__.'/Commands');
  51. require base_path('routes/console.php');
  52. }
  53. }