Kernel.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\AutoClearLog;
  4. use App\Console\Commands\AutoJob;
  5. use App\Console\Commands\AutoReportNode;
  6. use App\Console\Commands\AutoStatisticsNodeDailyTraffic;
  7. use App\Console\Commands\AutoStatisticsNodeHourlyTraffic;
  8. use App\Console\Commands\AutoStatisticsUserDailyTraffic;
  9. use App\Console\Commands\AutoStatisticsUserHourlyTraffic;
  10. use App\Console\Commands\DailyJob;
  11. use App\Console\Commands\NodeStatusDetection;
  12. use App\Console\Commands\ServiceTimer;
  13. use App\Console\Commands\UserExpireAutoWarning;
  14. use App\Console\Commands\UserFree;
  15. use App\Console\Commands\UserTrafficAbnormalAutoWarning;
  16. use App\Console\Commands\UserTrafficAutoWarning;
  17. use Illuminate\Console\Scheduling\Schedule;
  18. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  19. class Kernel extends ConsoleKernel
  20. {
  21. /**
  22. * The Artisan commands provided by your application.
  23. *
  24. * @var array
  25. */
  26. protected $commands = [
  27. AutoClearLog::class,
  28. AutoJob::class,
  29. AutoReportNode::class,
  30. AutoStatisticsNodeDailyTraffic::class,
  31. AutoStatisticsNodeHourlyTraffic::class,
  32. AutoStatisticsUserDailyTraffic::class,
  33. AutoStatisticsUserHourlyTraffic::class,
  34. DailyJob::class,
  35. NodeStatusDetection::class,
  36. ServiceTimer::class,
  37. UserExpireAutoWarning::class,
  38. UserTrafficAbnormalAutoWarning::class,
  39. UserTrafficAutoWarning::class,
  40. UserFree::class
  41. ];
  42. /**
  43. * Define the application's command schedule.
  44. *
  45. * @param Schedule $schedule
  46. * @return void
  47. */
  48. protected function schedule(Schedule $schedule)
  49. {
  50. $schedule->command('autoJob')->everyMinute();
  51. $schedule->command('serviceTimer')->everyTenMinutes();
  52. $schedule->command('autoClearLog')->everyThirtyMinutes();
  53. $schedule->command('nodeStatusDetection')->everyTenMinutes();
  54. $schedule->command('autoStatisticsNodeHourlyTraffic')->hourly();
  55. $schedule->command('autoStatisticsUserHourlyTraffic')->hourly();
  56. $schedule->command('userTrafficAbnormalAutoWarning')->hourly();
  57. $schedule->command('dailyJob')->everyFiveMinutes();
  58. $schedule->command('autoReportNode')->dailyAt('09:00');
  59. $schedule->command('userTrafficAutoWarning')->dailyAt('10:30');
  60. $schedule->command('userExpireAutoWarning')->dailyAt('20:00');
  61. $schedule->command('autoStatisticsUserDailyTraffic')->dailyAt('23:55');
  62. $schedule->command('autoStatisticsNodeDailyTraffic')->dailyAt('23:57');
  63. }
  64. /**
  65. * Register the commands for the application.
  66. *
  67. * @return void
  68. */
  69. protected function commands()
  70. {
  71. $this->load(__DIR__.'/Commands');
  72. require base_path('routes/console.php');
  73. }
  74. }