2017-11-01 11 views
0

私はLaravel Schedulerにいくつかのコマンドを実行しようとしていますが、php artisan schedule:runを実行すると、kernal.phpファイルのコマンドの1つのみが実行されます。Artisan Scheduleがすべてのコマンドを実行していません

マイ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

出力が少し誤解を招く可能性がありますが、実際には有効です。あなたが実行するときに5分ごとに実行するために毎分を実行しているa:importを設定し、b:import

PHPの職人のスケジュールを:実行

あなたはa:importコマンドが5回しばしばb:import

0

よりも実行されたことがわかりますあなたはcronをセットアップしましたか?もちろん実行することはありません...

0

crontabにscheduleコマンドを追加しましたか?

関連する問題