Kernel.php 2.0 KB

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