Skip to content

Instantly share code, notes, and snippets.

@activefx
Created January 22, 2013 03:39
Show Gist options
  • Save activefx/4591868 to your computer and use it in GitHub Desktop.
Save activefx/4591868 to your computer and use it in GitHub Desktop.
resque initializer
# Require to rescue Resque::TermException errors in the perfrom method
require 'resque/errors'
# Load the servers to enable to web interfaces
require 'resque/server'
require 'resque_scheduler/server'
# Create a global variable to access the Redis DB
$redis = Rails.env == 'test' ? Redis.new : configatron.redis.server
# Tell Resque to use the defined Redis DB
Resque.redis = $redis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment