vendredi 4 décembre 2015

Larvel 5.1 before callback is not working

In task scheduler in Laravel 5.1 before callback not working:

protected function schedule(Schedule $schedule)
{
    $schedule->command('inspire')->hourly();
    $schedule->command('view:clear')->daily();
    $schedule->call(function(){
        ToolsController::fixCategory();
        })
        ->everyMinute()
        ->before(function () {
            // Task is about to start...
            Log::info('Start fixing Category');
        })
        ->after(function () {
            // Task is complete...
            Log::info('End fixing Category');
        });

}

In log file:

[2015-12-04 12:02:22] local.INFO: End fixing Category  
[2015-12-04 12:06:08] local.INFO: End fixing Category  

Any idea ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire