Reputation: 2965
I am working now in Laravel 5.4 and configured the queue driver as database and created the jobs migration.
Controller
public function addUser(){
$job = (new SendReminderEmail())->delay(Carbon::now()->addSeconds(200));
dispatch($job);
dd('Job Completed');
}
Queue
public function handle()
{
$input = ['name'=>'John','email'=>str_random(7),'password'=>Hash::make('general'),];
DB::table('users')->insert($input);
}
This process successfully inserting job row in jobs table. But I gave 200 seconds for execution delay. But its not firing after time reaches.
How this happening ? Is there any configuration needed more to work queues. ?
Upvotes: 1
Views: 2901
Reputation: 431
Run php artisan queue:listen
or php artisan queue:work
. These must be run for Artisan to bootstrap the application and run in the background checking for new queue jobs, without it the only queue type that will work is 'sync'.
Upvotes: 2