Kernel.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. \App\Console\Commands\AutoJob::class,
  14. \App\Console\Commands\AutoClearLog::class,
  15. \App\Console\Commands\AutoDecGoodsTraffic::class,
  16. \App\Console\Commands\AutoResetUserTraffic::class,
  17. \App\Console\Commands\AutoCheckNodeStatus::class,
  18. \App\Console\Commands\AutoStatisticsNodeDailyTraffic::class,
  19. \App\Console\Commands\AutoStatisticsNodeHourlyTraffic::class,
  20. \App\Console\Commands\AutoStatisticsUserDailyTraffic::class,
  21. \App\Console\Commands\AutoStatisticsUserHourlyTraffic::class,
  22. \App\Console\Commands\UserTrafficAbnormalAutoWarning::class,
  23. \App\Console\Commands\UserExpireAutoWarning::class,
  24. \App\Console\Commands\UserTrafficAutoWarning::class,
  25. ];
  26. /**
  27. * Define the application's command schedule.
  28. *
  29. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  30. *
  31. * @return void
  32. */
  33. protected function schedule(Schedule $schedule)
  34. {
  35. $schedule->command('autoJob')->everyMinute();
  36. $schedule->command('autoClearLog')->everyThirtyMinutes();
  37. $schedule->command('autoDecGoodsTraffic')->everyTenMinutes();
  38. $schedule->command('autoResetUserTraffic')->everyFiveMinutes();
  39. $schedule->command('autoCheckNodeStatus')->hourly();
  40. $schedule->command('autoStatisticsNodeDailyTraffic')->dailyAt('23:55');
  41. $schedule->command('autoStatisticsNodeHourlyTraffic')->hourly();
  42. $schedule->command('autoStatisticsUserDailyTraffic')->dailyAt('23:50');
  43. $schedule->command('autoStatisticsUserHourlyTraffic')->hourly();
  44. $schedule->command('userTrafficAbnormalAutoWarning')->hourly();
  45. $schedule->command('userExpireAutoWarning')->dailyAt('10:20');
  46. $schedule->command('userTrafficAutoWarning')->dailyAt('10:30');
  47. }
  48. /**
  49. * Register the Closure based commands for the application.
  50. *
  51. * @return void
  52. */
  53. protected function commands()
  54. {
  55. require base_path('routes/console.php');
  56. }
  57. }