Kernel.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace App\Console;
  3. use App\Utils\CacheKey;
  4. use Illuminate\Console\Scheduling\Schedule;
  5. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  6. use Illuminate\Support\Facades\Cache;
  7. class Kernel extends ConsoleKernel
  8. {
  9. /**
  10. * The Artisan commands provided by your application.
  11. *
  12. * @var array
  13. */
  14. protected $commands = [
  15. //
  16. ];
  17. /**
  18. * Define the application's command schedule.
  19. *
  20. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  21. * @return void
  22. */
  23. protected function schedule(Schedule $schedule)
  24. {
  25. Cache::put(CacheKey::get('SCHEDULE_LAST_CHECK_AT', null), time());
  26. // v2board
  27. $schedule->command('v2board:statistics')->dailyAt('0:10');
  28. // check
  29. $schedule->command('check:order')->everyMinute();
  30. $schedule->command('check:commission')->everyMinute();
  31. $schedule->command('check:ticket')->everyMinute();
  32. $schedule->command('check:user')->daily();
  33. // reset
  34. $schedule->command('reset:traffic')->daily();
  35. $schedule->command('reset:log')->daily();
  36. // send
  37. $schedule->command('send:remindMail')->dailyAt('11:30');
  38. // horizon metrics
  39. $schedule->command('horizon:snapshot')->everyFiveMinutes();
  40. }
  41. /**
  42. * Register the commands for the application.
  43. *
  44. * @return void
  45. */
  46. protected function commands()
  47. {
  48. $this->load(__DIR__ . '/Commands');
  49. require base_path('routes/console.php');
  50. }
  51. }