Tuesday, May 23, 2017

Laravel schedule operation

Cron tasks has it's own scheduler: https://laravel.com/docs/5.4/scheduling and I just wondering is it possible somehow to achieve similar effect to run some task every 5 minutes ( wihout overlaping ) when calling command from command. For example:

Task1 is called every 1 minute:

$schedule->command('Task1')->everyMinute()

In this Task1 command I would like to call command Task2 every 5 minutes.

$schedule->command('Task2')->every5Minute()

Would it work having in mind that only Task1 is registered in Console/Kernel.php and Task2 is called from Task1?



via deividaspetraitis

Advertisement