N
N
NikolayAlb2017-04-17 15:29:37
Laravel
NikolayAlb, 2017-04-17 15:29:37

Laravel 5.4 event queue fails (max retries) and failed() is not called?

I have an event called when the project is deleted:

<?php

namespace App\Listeners;

use App\Events\ProjectDeleted;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class DeleteProjectData implements ShouldQueue
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  ProjectDeleted  $event
     * @return void
     */
    public function handle(ProjectDeleted $event)
    {
        \Log::info('PROJECT DELETED FAKE LOG');
    }

    public function failed(ProjectDeleted $event, Exception $exception)
    {
        \Log::info('Failed, exception:');
        \Log::info($exception);
    }
}

In .env I wrote:
//***
QUEUE_DRIVER=database
//***

Also migrated the jobs table.
As a result, at the time of deleting the project in queue:work, I get the following:
[2017-04-17 00:43:15] Processing: App\Listeners\DeleteProjectData
[2017-04-17 00:43:15] Processing: App\Listeners\DeleteProjectData
[2017-04-17 00:43:15] Processing: App\Listeners\DeleteProjectData
[2017-04-17 00:43:15] Processing: App\Listeners\DeleteProjectData
//и так 255 раз

I can't understand why the queue is not processing the request, and failed() is simply not being called, what should I do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2017-04-17
@NikolayAlb

So like --tries you need to set queue: work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question