Created
February 20, 2012 07:42
-
-
Save vpamulap/1868296 to your computer and use it in GitHub Desktop.
config/initializers/recommendable.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "redis" | |
require "resque" | |
require "resque-loner" | |
ENV["REDISTOGO_URL"] ||= "redis://vpamulap:[email protected]:9220/" | |
uri = URI.parse(ENV["REDISTOGO_URL"]) | |
# Recommendable requires a connection to a running redis-server. Either create | |
# a new instance based on a host/port or UNIX socket, or pass in an existing | |
# Redis client instance. | |
Recommendable.redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password) | |
# Connect to Redis via a UNIX socket instead | |
# Recommendable.redis = Redis.new(:sock => "") | |
# Tell Redis which database to use (usually between 0 and 15). The default of 0 | |
# is most likely okay unless you have another application using that database. | |
# Recommendable.redis.select "0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment