Monday, March 20, 2017

Laravel command executed in loop

Are there any specific reasons for a command App/Console/Commands/ImportSecond.php to be executed in loop ?

It is launched at the end of the script of the job App/Jobs/ImportFirst.php :

 \Artisan::call('import:second', 
["bid" => $$bid, 
'filename' => "$name.$extension"]
);

The job itself is called by a Controller this way :

$this->dispatch (new ImportFirst($bid, \Input::file('file')->getClientOriginalName()));

To sum up : BController.php dispatch ImportFirst job to Redis, which launch ImportSecond at last

BController.php -> ImportFirst (job) -> ImportSecond (command)

Laravel version : 5.1.26 - Queue driver : Redis



via Adeline Mani-Rajan

Advertisement