2017-11-01 2 views
0

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 

내가 무엇을 놓쳤는 지 또는 내가해야 할 일을 식별하는 데 도움이된다면 감사하겠습니다.

답변

0

출력이 약간 잘못된 것일 수 있지만 실제로 유효합니다.

PHP 장인 일정 :

을 실행하면 a:import 명령 b:import

0

보다 5 배 자주 실행 된 것을 볼 수 있습니다 실행할 때 당신은 너무 5 분마다 실행 a:import 분마다 실행하고 b:import 설정 cron을 설치 했습니까? 물론 실행하지 마십시오.

0

crontab에 schedule 명령을 추가 했습니까?