This is a follow on post from something I posted few weeks back about Laravel 4 & Dokku: Queue Workers.
In the original post I said something silly:
I could run the queue command on another server under supervisor but that would be lame and require me to run two copies of our project. No way!
That's all wrong. We don't need to run two copies of our application because there exists a Dokku plugin that binds all of your Dokku processes with Supervisor ensuring that they come straight back up again if they go down.
dokku-supervisord is the perfect plugin for making queues even better.
Lately we've been having a few connection issues and our queue has stopped processing once the connect has been restored, leaving us with hundreds of jobs to process once it comes back up again. Although it recovers once the instance is restarted, it requires manual work and as a programmer I hate manual work. If I can automate something, I will.
dokku-supervisord and then restarting my container instantly starts
supervisord with it. Now, when the connection drops, the worker dies and will start back up again. It's brilliant!