Handle db connection and disconnection during forking of resque jobs on Heroku cedar stack.
Fixes the following postgres log errors…
PGError: server closed the connection unexpectedly
LOG: could not receive data from client: Connection reset by peer LOG: unexpected EOF on client connection
This is not an official Heroku gem.
Install the gem in your Gemfile
Include Resque::Heroku in your job classes
require 'resque/plugins/heroku' class Job extend Resque::Plugins::Heroku def self.perform # do stuff end end
Load resque-heroku tasks from your Rakefile
Now rake jobs:work is available.