Kernel.php 2.6 KB

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