3

I'm creating an application with the Laravel 5.2 framework. In my application there is a job that I want to fire 2 days after the event.

This is the code where an instance of the right job is made and where I set the delay to the amount of seconds that equals 2 days.

 $job = (new RemoveNotPayedOrder($order))->delay(172800);

 $this->dispatch($job);

Right when the code reaches the dispatch method the job gets fired instantly instead of waiting the seconds specified by me in the delay method.

I generated the Job class with the make:job command provided by php artisan.

I've read the docs: http://laravel.com/docs/5.1/queues#delayed-jobs and I think my code is correct. Any ideas on what could be wrong?

4

1 回答 1

11

问题最终是队列驱动程序(in config/queue.php)被设置为“同步”。

于 2015-06-18T17:41:30.693 回答