laravel5.1工作不在后台工作

时间:2017-02-09 15:19:10

标签: php laravel-5 queue

我使用了带有jenssegers集成的laravel 5.1。 我创建了一个创建CSV文件的作业。 我已按照步骤将此作业执行到后台 -

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

但是,执行还等了120秒,然后我的控制器返回jobId作为响应。

我的问题是如何在后台处理这项工作?

0 个答案:

没有答案