vendredi 18 mars 2016

How Laravel knows when the scheduler has been updated?

My question is more of a general wondering. I have two commands created using Laravel, let's call them A and B.

Each one of these commands are scheduled with the ->dailyAt($par) method. But the $par parameter comes from a query.

I mean something like this:

protected function schedule(Schedule $schedule)
{
    $schedulerTime_commandA = App\Model\CommandsTime::where('id', 1)->first()->time;
    $schedulerTime_commandB = App\Model\CommandsTime::where('id', 2)->first()->time;

    $schedule->command('A')
            ->dailyAt($schedulerTime_commandA);

    $schedule->command('B')
            ->dailyAt($schedulerTime_commandB);
}

This is because the superuser wants to schedule the time when those commands will run. My question here is: How Laravel knows this schedule method within the App\Console\Kernel.php file has been changed?

NOTE: I have the following cron entry as Laravel talks about it on the docs.

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire