Kernel.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. * Define the application's command schedule.
  9. *
  10. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  11. * @return void
  12. */
  13. protected function schedule(Schedule $schedule)
  14. {
  15. $schedule->command('upgrade:daily')
  16. ->dailyAt('00:00')
  17. ->emailOutputTo(config("mint.email.ScheduleEmailOutputTo"))
  18. ->emailOutputOnFailure(config("mint.email.ScheduleEmailOutputOnFailure"));
  19. $schedule->command('upgrade:weekly')
  20. ->weekly()
  21. ->emailOutputOnFailure(config("mint.email.ScheduleEmailOutputOnFailure"));
  22. $schedule->command('app:index-open-search')
  23. ->everyFiveMinutes()
  24. ->emailOutputOnFailure(config("mint.email.ScheduleEmailOutputOnFailure"));
  25. }
  26. /**
  27. * Register the commands for the application.
  28. *
  29. * @return void
  30. */
  31. protected function commands()
  32. {
  33. $this->load(__DIR__ . '/Commands');
  34. require base_path('routes/console.php');
  35. }
  36. /**
  37. * Get the timezone that should be used by default for scheduled events.
  38. *
  39. * @return \DateTimeZone|string|null
  40. */
  41. protected function scheduleTimezone()
  42. {
  43. return 'Asia/Shanghai';
  44. }
  45. }