Kernel.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. * @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('nodeBlockedDetection')->everyTenMinutes();
  54. $schedule->command('autoStatisticsNodeHourlyTraffic')->hourly();
  55. $schedule->command('autoStatisticsUserHourlyTraffic')->hourly();
  56. $schedule->command('userTrafficAbnormalAutoWarning')->hourly();
  57. $schedule->command('autoPingNode')->twiceDaily();
  58. $schedule->command('dailyJob')->daily();
  59. $schedule->command('autoReportNode')->dailyAt('09:00');
  60. $schedule->command('userTrafficAutoWarning')->dailyAt('10:30');
  61. $schedule->command('userExpireAutoWarning')->dailyAt('20:00');
  62. $schedule->command('autoStatisticsUserDailyTraffic')->dailyAt('23:55');
  63. $schedule->command('autoStatisticsNodeDailyTraffic')->dailyAt('23:57');
  64. }
  65. /**
  66. * Register the commands for the application.
  67. *
  68. * @return void
  69. */
  70. protected function commands()
  71. {
  72. $this->load(__DIR__.'/Commands');
  73. require base_path('routes/console.php');
  74. }
  75. }