Faramarz Salehpour
Faramarz Salehpour

Reputation: 601

Do I need to create a failed jobs table when using Redis as queue driver in laravel 5.2?

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

Answers (1)

Duru Can Celasun
Duru Can Celasun

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

Related Questions