Kernel.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. * @return void
  38. */
  39. protected function schedule(Schedule $schedule): void
  40. {
  41. $schedule->command('serviceTimer')->everyFiveMinutes();
  42. $schedule->command('nodeStatusDetection')->everyTenMinutes();
  43. $schedule->command('autoClearLogs')->everyThirtyMinutes();
  44. $schedule->command('task:hourly')->hourly();
  45. $schedule->command('task:daily')->dailyAt('02:30');
  46. $schedule->command('dailyNodeReport')->dailyAt('09:30');
  47. $schedule->command('userTrafficWarning')->dailyAt('10:30');
  48. $schedule->command('userExpireWarning')->dailyAt('20:30');
  49. $schedule->command('task:auto')->everyMinute();
  50. $schedule->command('task:monthly')->monthly();
  51. }
  52. /**
  53. * Register the commands for the application.
  54. *
  55. * @return void
  56. */
  57. protected function commands(): void
  58. {
  59. $this->load(__DIR__.'/Commands');
  60. require base_path('routes/console.php');
  61. }
  62. }