Automatically handle db connection and disconnection during forking of resque jobs on Heroku Cedar stack.
This plugin is for Rails only since it hooks into ActiveRecord callbacks.
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
Require the module in an initializer (config/initializers/resque.rb)
Extend the worker classes
class Job extend Resque::Plugins::Heroku def self.perform # do stuff end end
Require this file in your Rakefile
Start the Resque worker in your Procfile using `rake jobs:work`
worker: bundle exec rake jobs:work