Resqovery “Resque Recovery”

It adds a method safe_enqueue to Resque module.

Installation

In Rails 3, add following line to your Gemfile and run the bundle command.

gem "resqovery"

In Rails 2, add following line to your environment.rb file.

config.gem "resqovery"

Getting Started

There couple of generators. you can run rails g reqovery:install -h to see what they do

resqovery:install
resqovery:migration

In case you want to rename default model/table for storing jobs (default name is “ResqueJob”):

rails g resqovery:install -m [MODEL_NAME]
rails g resqovery:install -m backup_job

After creating migration and running them by rake db:migrate, you can create jobs as before using:

Resque.enqueue Archive, "master"

or using following one which store the job in DB before calling resque

Resque.safe_enqueue Archive, "master"