Kernel.php 2.6 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\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. * 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. upgradeUserResetTime::class,
  39. UserExpireAutoWarning::class,
  40. UserTrafficAbnormalAutoWarning::class,
  41. UserTrafficAutoWarning::class,
  42. ];
  43. /**
  44. * Define the application's command schedule.
  45. *
  46. * @param Schedule $schedule
  47. *
  48. * @return void
  49. */
  50. protected function schedule(Schedule $schedule) {
  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:50');
  64. $schedule->command('autoStatisticsNodeDailyTraffic')->dailyAt('23:55');
  65. }
  66. /**
  67. * Register the commands for the application.
  68. *
  69. * @return void
  70. */
  71. protected function commands() {
  72. $this->load(__DIR__.'/Commands');
  73. require base_path('routes/console.php');
  74. }
  75. }