Closed dwbutler closed 10 years ago
Okay, I think this should do it.
The worker rake task should exit normally with code 0 if it breaks out of a sleep or exits gracefully. It will only exit abnormally with code 1 if it aborts a currently running job.
Nice! I had given up all hope on this.
@dwbutler fear not! :) Hoping to get a few more things together and cut a beta. We'll see.
This pull request implements graceful shutdown for Qu workers. I needed to make the change because when a worker aborts, it sometimes wouldn't be able to re-queue the job into the failure queue due to the Mongoid connection already being closed. So jobs would mysteriously go missing.
Features:
Qu.graceful_shutdown = true