resque/resque — pull request #1248 by joshughes (2014-08-14 16:18:35+00:00)
Title: Set pidfile so god monitors the correct process

The current example causes the resque worker launched to flap because the pid that god is monitoring is the pid for the rake process launching the resque worker. A more robust solution is to have god monitor the pid of the pid file created by resque when the worker is fully up and running.

This solution stopped my worker from flapping. It may only be the case for when workers take a while to start since our app has a slow startup time, but in general I believe this will work in all cases, where the current example has the flapping issue I experienced.