Kernel.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\AutoClearLog;
  4. use App\Console\Commands\AutoJob;
  5. use App\Console\Commands\AutoPingNode;
  6. use App\Console\Commands\AutoReportNode;
  7. use App\Console\Commands\AutoStatisticsNodeDailyTraffic;
  8. use App\Console\Commands\AutoStatisticsNodeHourlyTraffic;
  9. use App\Console\Commands\AutoStatisticsUserDailyTraffic;
  10. use App\Console\Commands\AutoStatisticsUserHourlyTraffic;
  11. use App\Console\Commands\DailyJob;
  12. use App\Console\Commands\NodeBlockedDetection;
  13. use App\Console\Commands\ServiceTimer;
  14. use App\Console\Commands\UserExpireAutoWarning;
  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. AutoPingNode::class,
  30. AutoReportNode::class,
  31. AutoStatisticsNodeDailyTraffic::class,
  32. AutoStatisticsNodeHourlyTraffic::class,
  33. AutoStatisticsUserDailyTraffic::class,
  34. AutoStatisticsUserHourlyTraffic::class,
  35. DailyJob::class,
  36. NodeBlockedDetection::class,
  37. ServiceTimer::class,
  38. UserExpireAutoWarning::class,
  39. UserTrafficAbnormalAutoWarning::class,
  40. UserTrafficAutoWarning::class,
  41. ];
  42. /**
  43. * Define the application's command schedule.
  44. *
  45. * @param Schedule $schedule
  46. *
  47. * @return void
  48. */
  49. protected function schedule(Schedule $schedule)
  50. {
  51. $schedule->command('autoJob')->everyMinute();
  52. $schedule->command('serviceTimer')->everyTenMinutes();
  53. $schedule->command('autoClearLog')->everyThirtyMinutes();
  54. $schedule->command('nodeBlockedDetection')->everyTenMinutes();
  55. $schedule->command('autoStatisticsNodeHourlyTraffic')->hourly();
  56. $schedule->command('autoStatisticsUserHourlyTraffic')->hourly();
  57. $schedule->command('userTrafficAbnormalAutoWarning')->hourly();
  58. $schedule->command('autoPingNode')->twiceDaily();
  59. $schedule->command('dailyJob')->daily();
  60. $schedule->command('autoReportNode')->dailyAt('09:00');
  61. $schedule->command('userTrafficAutoWarning')->dailyAt('10:30');
  62. $schedule->command('userExpireAutoWarning')->dailyAt('20:00');
  63. $schedule->command('autoStatisticsUserDailyTraffic')->dailyAt('23:55');
  64. $schedule->command('autoStatisticsNodeDailyTraffic')->dailyAt('23:57');
  65. }
  66. /**
  67. * Register the commands for the application.
  68. *
  69. * @return void
  70. */
  71. protected function commands()
  72. {
  73. $this->load(__DIR__.'/Commands');
  74. require base_path('routes/console.php');
  75. }
  76. }