Run Resque on Heroku
Ruby
Switch branches/tags
Pull request Compare This branch is 8 commits behind simple10:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/resque/plugins
spec
.gitignore
Gemfile
Rakefile
readme.rdoc
resque-heroku.gemspec

readme.rdoc

Overview

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

And

LOG:  could not receive data from client: Connection reset by peer
LOG:  unexpected EOF on client connection

This is not an official Heroku gem.

Usage

Install the gem in your Gemfile

gem 'resque-heroku'

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

require 'resque/plugins/heroku/tasks'

Now rake jobs:work is available.