I am trying to use mail queuing in laravel 5.4.
Here's my route closure:
Route::get('mail/queue', function() {
$job = (new SendEmailJob())->delay(Carbon::now()->addSeconds(5));
dispatch($job);
return 'Email will be sent shortly..';
});
And mailable class :
public function build()
{
return $this->view('welcome');
}
Job class:
public function handle()
{
Mail::to('abc@gmail.com')->send(new SendEmailMailable());
}
I run php artisan queue:work in the terminal.
And then load the mail/queue route. Output is sent to the browser instantly, and after 5 seconds job is processing.
But it seems like it is going forever, also attempts column increases until it hits 255.
Here's how it looks:
jobs table:
failed_jobs table is empty but the job never gets processed.
via Chebli Mohamed


Aucun commentaire:
Enregistrer un commentaire