user846437
user846437

Reputation:

Laravel queue supervisor doesn't reread the updates

I use Laravel's queues mostly for API jobs, I store the API token in database, everything works okay until the token is needed to be refreshed.

For some reason queue doesn't reread the new token from database. I guess it is cached somehow, but php artisan cache:clear doesn't change anything. I run the test with the commands and queue. If I dump the token in the command, it is shown updated, but queue shows the old token.

supervisorctl restart appname fixes the issue, but I want to make it work without restarting the queue. Any tips?

Upvotes: 2

Views: 2234

Answers (1)

Odyssee
Odyssee

Reputation: 2463

Queue workers are long-lived processes and store the booted application state in memory. As a result, they will not notice changes in your code base after they have been started. So, during your deployment process, be sure to restart your queue workers.

php artisan queue:restart

Upvotes: 7

Related Questions