Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

TerraCycleUS/resque_utils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ResqueUtils

ResqueUtils is a gem that gives you extra helper cap commands for use with Resque.

Requirements

  • Capistrano
  • Resque

Installation

Firstly you'll need to install the gem, if you are using bundler add this to your Gemfile (but make sure it doesn't go in a gem group that isn't being sent to the server)...

gem 'resque_utils'

Open your deploy.rb and simple require the file...

require 'resque_utils/capistrano'

You'll then have the following commands available to you...

cap resque:failed:remove_all       # Remove all failed jobs
cap resque:failed:remove_specific  # Remove specific failed jobs (specify with '--set exception=SomeError')
cap resque:failed:remove_retried   # Remove all retried jobs
cap resque:failed:requeue_all      # Requeue all failed jobs
cap resque:failed:requeue_specific # Requeue specific failed jobs (specify with '--set exception=SomeError')

Obviously you won't want this to run on all your nodes, so make sure to filter to the node you want when you run it...

HOSTFILTER=resque.somedomain.com cap resque:failed:remove_all

To run the specific commands, for example to requeue any job that failed with the exception SomeError...

cap resque:failed:requeue_specific --set exception=SomeError

You could also do something like this, although i'd really not recommend it...

before 'deploy:symlink', 'resque:failed:remove_all'

About

Capistrano helper tasks for Resque (requeue & remove failed jobs)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%