Kernel.php 2.7 KB

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