Skip to content

Instantly share code, notes, and snippets.

@MikeSilvis
Created July 5, 2012 19:42
Show Gist options
  • Save MikeSilvis/3055975 to your computer and use it in GitHub Desktop.
Save MikeSilvis/3055975 to your computer and use it in GitHub Desktop.
redis.rb
require 'resque'
if Rails.env.production?
redis_url = ENV["REDISTOGO_URL"]
uri = URI.parse(redis_url)
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
else
REDIS = Redis.new
end
Resque.redis = REDIS
Resque.after_fork = Proc.new { ActiveRecord::Base.establish_connection }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment