dimanche 29 novembre 2015

How can i run Laravel Queue only once?

I used laravel 5.1 Queue for my background function with async. But i want to run that function for only 1 time. If that function fail, i want to do other process. How can i detect my job is failed or not? Am i doing right or wrong ? What should i change? ps: I'm beginner. I used like this in my controller.

$job = new myjob($var1, $var2);
$this->dispatch($job);
$job->release();
if ($job->attempts() >= 1)
{
    $job->delete();
    //will do other process
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire