I have a question about the task scheduling in laravel framework. I already have defined the commands currency:update
and currency:archive
in the list of console commands. Now, I want to run these two commands in the schedule method but with the following condition:
if this is a time to run the currency:archive
command, don't run the other command currency:update
until the previous command (i.e. currency:archive
) ends; otherwise run the currency:update
command.
This is my current code in schedule method:
$schedule->command('currency:archive')
->dailyAt('00:00')
->withoutOverlapping();
$schedule->command('currency:update')
->everyMinute()
->withoutOverlapping();
How should I modify it?
Thanks.