Reputation: 601
I'm using redis
as the queue driver for Laravel 5.2. My problem is when a job fails, I get an exception in laravel.log which says PDO
couldn't find the failed_jobs
table.
I know I can use artisan
to create the migration for creating failed jobs table, but do I need to do this when I'm running the queue on redis?
Upvotes: 4
Views: 1023
Reputation: 1681
NO, you don't have to. Failed jobs are handled by DatabaseFailedJobProvider
, which implements FailedJobProviderInterface
. You can implement this interface yourself with the backend of your choice. You also need to extend QueueServiceProvider
and replace the registerFailedJobServices()
method with your implementation of FailedJobProviderInterface
:
/**
* Register the failed job services.
*
* @return void
*/
protected function registerFailedJobServices()
{
$this->app->singleton('queue.failer', function ($app) {
// Your implementation here.
});
}
Upvotes: 4