Kernel.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\AutoClearLogs;
  4. use App\Console\Commands\AutoJob;
  5. use App\Console\Commands\DailyJob;
  6. use App\Console\Commands\DailyNodeReport;
  7. use App\Console\Commands\NodeDailyTrafficStatistics;
  8. use App\Console\Commands\NodeHourlyTrafficStatistics;
  9. use App\Console\Commands\NodeStatusDetection;
  10. use App\Console\Commands\ServiceTimer;
  11. use App\Console\Commands\UserDailyTrafficStatistics;
  12. use App\Console\Commands\UserExpireWarning;
  13. use App\Console\Commands\UserHourlyTrafficMonitoring;
  14. use App\Console\Commands\UserTrafficWarning;
  15. use Illuminate\Console\Scheduling\Schedule;
  16. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  17. class Kernel extends ConsoleKernel
  18. {
  19. /**
  20. * The Artisan commands provided by your application.
  21. *
  22. * @var array
  23. */
  24. protected $commands = [
  25. AutoClearLogs::class,
  26. AutoJob::class,
  27. DailyJob::class,
  28. DailyNodeReport::class,
  29. NodeDailyTrafficStatistics::class,
  30. NodeHourlyTrafficStatistics::class,
  31. NodeStatusDetection::class,
  32. ServiceTimer::class,
  33. UserDailyTrafficStatistics::class,
  34. UserExpireWarning::class,
  35. UserHourlyTrafficMonitoring::class,
  36. UserTrafficWarning::class,
  37. ];
  38. /**
  39. * Define the application's command schedule.
  40. *
  41. * @param Schedule $schedule
  42. * @return void
  43. */
  44. protected function schedule(Schedule $schedule)
  45. {
  46. $schedule->command('autoJob')->everyMinute();
  47. $schedule->command('nodeStatusDetection')->everyTenMinutes();
  48. $schedule->command('serviceTimer')->everyTenMinutes();
  49. $schedule->command('autoClearLogs')->everyThirtyMinutes();
  50. $schedule->command('nodeHourlyTrafficStatistics')->hourly();
  51. $schedule->command('userHourlyTrafficMonitoring')->hourly();
  52. $schedule->command('dailyJob')->daily();
  53. $schedule->command('dailyNodeReport')->dailyAt('09:00');
  54. $schedule->command('userTrafficWarning')->dailyAt('10:30');
  55. $schedule->command('userExpireWarning')->dailyAt('20:00');
  56. $schedule->command('userDailyTrafficStatistics')->dailyAt('23:55');
  57. $schedule->command('nodeDailyTrafficStatistics')->dailyAt('23:57');
  58. }
  59. /**
  60. * Register the commands for the application.
  61. *
  62. * @return void
  63. */
  64. protected function commands()
  65. {
  66. $this->load(__DIR__.'/Commands');
  67. require base_path('routes/console.php');
  68. }
  69. }