Laravel Scheduler에서 몇 가지 명령을 실행하려고하는데, php artisan schedule:run
을 실행하면 kernal.php 파일의 명령 중 하나만 실행합니다. 다음과 같이Artisan Schedule run all commands 실행하지 않음
내 Kernal.php 파일은 다음과 같습니다
protected $commands = [
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('a:import')->everyMinute();
$schedule->command('b:import')->everyFiveMinutes();
}
/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
require base_path('routes/console.php');
}
내 console.php 파일에 다음 코드가 있습니다
Artisan::command('a:import', function(a\ImportController $runner) {
$runner->init();
});
Artisan::command('b:import', function(b\ImportController
$runner) {
$runner->beginImport();
});
을 내가 PHP 장인 일정을 실행하면 실행 나는 다음과 같은 얻을 결과 :
D:\development\v2> php artisan schedule:run
´╗┐Running scheduled command: "C:\Program Files\PHP\v7.0\php.exe" "artisan" a:import > "NUL" 2>&1
내가 무엇을 놓쳤는 지 또는 내가해야 할 일을 식별하는 데 도움이된다면 감사하겠습니다.