Ben
Ben

Reputation: 702

Laravel 5.1.x database queue jobs not being attempted

I successfully had queued tasks working on a test site, and updated my live site (same server). The live queue is now just filling up without being processed, or attempted. I am using forge, and that is running a queue process. Can anyone help with what I can check next to find out why it wouldn't be working

Upvotes: 1

Views: 1465

Answers (2)

Luke Madhanga
Luke Madhanga

Reputation: 7487

So this is my first time working with Laravel Queues and the application that I'm building will need several different queues for priority purposes. The queue that I was testing had a name other than default. If you're using a named queue, make sure to add it to the artisan command

 php artisan queue:work <connection_name> --queue=<queue_name>

Upvotes: 0

Ben
Ben

Reputation: 702

I tried many things such as clearing the cache, restarting the worker, and was helped through checking supervisord was running the worker properly etc.

One final question I was asked by the person helping - was if the app was in maintenance mode. I answered no, because my site was live.

However, after reading https://divinglaravel.com/queue-system/workers :

If app in maintenance mode you can still process jobs if your worker run with the --force option:

I tried:

php artisan queue:work --force

I noticed that a job WAS processed, so I tried php artisan:up and everything worked.

Essentially, we have removed the maintenance middleware sometime ago, so the app WAS in maintenance mode technically, but was still live.

So if a queue is not processing at all, try three things:

php artisan:up
php artisan config:clear
php artisan queue:restart

Upvotes: 5

Related Questions