I have used laravel 5.1 with jenssegers integration. I have created one job which creates CSV file. I have followed steps to execute this job into background -
1) Got request parameters in Controller.
2) Process data and stored it into jobs table.
3) Using DispatchesJobs trait called this job by passing jobId
$this->dispatch((new ExportJobs($id))->delay(6000));
4) Return jobId for HTTP request.
Note: my CSV file data is too small so it don't take more time to create
so I have added sleep(120); into that job class.
5) hit PHP artisan queue:listen into terminal
But still, the execution waited for 120 seconds and then my controller return jobId as a response.
My question is how can I process this job in a background?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2k73WlC
via IFTTT
Aucun commentaire:
Enregistrer un commentaire