Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mtrapani's avatar

Supervisor and artisan queues

Hi, I'm using Supervisor to keep php artisan queue:listen running.

But when I deploy an updated job worker, the listener uses the previous PHP file, probably because I'm using a current symlink folder.

How do you handle this? I've tried changing the command from queue:listen to queue:work with autostart but I think is not a good idea.

Thanks!

0 likes
4 replies
DivDax's avatar

Same here. I'm using rocketeer to deploy my app and my latest release has a symlink "/var/www/myapp/current" -> "/var/www/myapp/releases/20150501010203". I think supervisord is caching the real path from my symlink folder, so i have to restart the queue manually... :(

toniperic's avatar

@DivDax does Rocketeer has a post-deployment hooks?

It's something Envoyer (link to Taylor's screencast) has and it's actually common stuff so probably Rocketeer has it as well.

Essentially, you'd probably just type in a command that restarts your queue server (like beanstalkd) in your post-deployment hooks, so whenever there's a deploy the queue server would be restarted automatically. It's not all that hard.

jimmy.puckett's avatar

@zupolgec, @DivDax & @toniperic I know that this is an old thread, but I was looking for a solution for my issue...

https://laracasts.com/discuss/channels/laravel/thread-safe-long-running-jobs-from-queue

and I ran across this, so I thought that I would post how we "solved" the issue that y'all where having.

We switched to "queue:work" with the "daemon" flag, which is the documented way in the current laravel docs...

http://laravel.com/docs/5.1/queues#supervisor-configuration

This allows you to run "php artisan queue:restart" from within the new symlink, so that the file handles are updated & the worker is using the latest version of the Job.

Hope this helps.

1 like

Please or to participate in this conversation.