Skip to content

Instantly share code, notes, and snippets.

@lipchyk
Created October 3, 2011 14:20
Show Gist options
  • Select an option

  • Save lipchyk/1259195 to your computer and use it in GitHub Desktop.

Select an option

Save lipchyk/1259195 to your computer and use it in GitHub Desktop.
My resque.rb initializer for Rails 3.x app (using resque, resque-retry, resque-scheduler)
require 'resque' # include resque so we can configure it
require 'yaml'
require 'resque/failure/redis'
require 'resque/failure/multiple'
require 'resque/plugins/retry'
require "resque-retry"
Resque::Failure::MultipleWithRetrySuppression.classes = [Resque::Failure::Redis]
Resque::Failure.backend = Resque::Failure::MultipleWithRetrySuppression
Resque.redis = Redis.new(:host => 'localhost', :port => 6379)
Resque.redis.namespace = "resque:app_#{Rails.env}" # separate redis namespace for dev/prod/test environments
require 'resque_scheduler' # include the resque_scheduler (this makes the tabs show up)
Resque.schedule = YAML.load_file(File.join(File.dirname(__FILE__), '../resque_schedule.yml'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment