Skip to content

Instantly share code, notes, and snippets.

@gotjosh
Created February 22, 2012 20:45
Show Gist options
  • Select an option

  • Save gotjosh/1887142 to your computer and use it in GitHub Desktop.

Select an option

Save gotjosh/1887142 to your computer and use it in GitHub Desktop.
if Rails.env.production?
uri = URI.parse(ENV['REDISTOGO_URL'])
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password, :thread_safe => true)
Resque.redis = REDIS
Resque.after_fork = proc {
Resque.redis = Redis::Objects.redis = $redis = REDIS.new(
:host => uri.host,
:port => uri.port,
:password => uri.password,
:thread_safe => true
)
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment