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?
The issue ended up being the queue driver (in
config/queue.php
) was set to 'synchronous'.