1

I am using Laravel forge with Redis as the queue driver.

I have updated the code for my application to send push notifications a few times over, but the notifications sent are as in the old code.

Changing the queue driver to database, sends the notifications as per the latest updates. However when I switched it back to Redis, it still shows old version of the notification.

I have done "FLUSHALL" via redis-cli, but it didn't fix it.

Also I use Laravel Horizon to manage queues.

How I can fix this? Thanks in advance.

Edit: Other thing I noticed was all code driven dispatches were queued on Redis. I have listed the solution in the answer in the hopes it would help someone else.

Santosh Achari
  • 2,936
  • 7
  • 30
  • 52

2 Answers2

3

What I received from Forge support:

Hello,

There might be a worker that's stuck you can try and run php artisan horizon:purge which should kill all rogue worker processes, and then restart the daemon. It's advised to run the purge command in your deployment script to make sure all stale processes are killed.

-- Mohamed Said forge@laravel.com

However this how I got it sorted:

php artisan horizon:terminate

php artisan queue:restart

And then the code was working properly

Santosh Achari
  • 2,936
  • 7
  • 30
  • 52
  • https://stackoverflow.com/a/51570378/470749 similarly said `php artisan queue:restart` which is what I did. – Ryan Aug 27 '21 at 21:23
0

Stop redis, Stop Horizon workers. Start redis and then start horizon workers. But before these all clear cache.

I had similar problem and in my case it was just the matter of restart all the services.

BetaDev
  • 4,516
  • 3
  • 21
  • 47