tom1337
tom1337

Reputation: 228

Laravel jobs (database) do not execute handle

I have a problem with laravel jobs. I configured laravel jobs to work with the database and it is working.

When I execute a job, the entry is created in database and the constructor is well executed.

However, the handle function is never executed ... and the jobs stay in the jobs table.

Someone already had this problem?

(I use Laravel 5.7).

Upvotes: 5

Views: 2149

Answers (2)

Jahanzaib Jb
Jahanzaib Jb

Reputation: 76

You should listen to the queue for default

php artisan queue:work

or

php artisan queue:work --sleep=1 --tries=5 --timeout=60

If you are not using the default queue then mention the custom queue

php artisan queue:work --sleep=1 --tries=5 --timeout=60 --queue customQueue

Upvotes: 1

tom1337
tom1337

Reputation: 228

I found the problem...

I'm using a different queue name that the default and in config/queue.php, in the database array you have the default queue name set to "default".

So when i execute : php artisan queue:work , he is waiting for default queue.

When i execute the command line : php artisan queue:work --queue QUEUENAME it is working !

Thanks everybody.

Upvotes: 3

Related Questions