| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace App\Console;
- use App\Console\Commands\CollectTaskAllocateAgainCommand;
- use App\Console\Commands\CollectTaskAllocateCommand;
- use App\Console\Commands\CollectTaskCommand;
- use App\Console\Commands\CollectEquipmentHeartbeatCheckCommand;
- use Illuminate\Console\Scheduling\Schedule;
- use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
- class Kernel extends ConsoleKernel
- {
- /**
- * The Artisan commands provided by your application.
- *
- * @var array
- */
- protected $commands = [
- CollectTaskAllocateAgainCommand::class,
- CollectTaskAllocateCommand::class,
- CollectTaskCommand::class,
- CollectEquipmentHeartbeatCheckCommand::class,
- ];
- /**
- * Define the application's command schedule.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- protected function schedule(Schedule $schedule)
- {
- $schedule->command('collect-task')->everyThirtyMinutes();
- $schedule->command('collect-task-allocate')->everyThirtyMinutes();
- $schedule->command('collect-task-allocate-again')->everyThirtyMinutes();
- $schedule->command('collect-equipment-heartbeat-check')->everyMinute();
- }
- /**
- * Register the commands for the application.
- *
- * @return void
- */
- protected function commands()
- {
- // 自动引入任务命令
- $this->load(__DIR__.'/Commands');
- // 引入任务路由
- require base_path('routes/console.php');
- }
- }
|