You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Daniel Cadenas edited this page Dec 17, 2013
·
3 revisions
It is very easy.
As mentioned in readme you can set the redis connection url
And since there is an ENV inside Heroku if you use RedisToGo, just use it:
# Make Split use Redis To Go on HerokuSplit.redis=ENV["REDISTOGO_URL"]ifENV["REDISTOGO_URL"]
Here is a config file of mine :)
# config/initializers/split.rbSplit.configuredo |config|
# config.robot_regex = /my_custom_robot_regex/ # Should set it# config.ignore_ip_addresses << '81.19.48.130' # You should set it using SettingsLogic or somethingconfig.db_failover=true# handle redis errors gracefullyconfig.db_failover_on_db_error=proc{|error| Rails.logger.error(error.message)}config.allow_multiple_experiments=true# It's fine for me, but might not for youconfig.enabled=trueendSplit::Dashboard.useRack::Auth::Basicdo |username,password|
username == 'fire_in' && password == 'the_hole'# This one is fake :PendifENV["REDISTOGO_URL"]uri=URI.parse(ENV["REDISTOGO_URL"])namespace=["split","myapp",Rails.env].join(":")redis=Redis.new(host: uri.host,port: uri.port,password: uri.password,thread_safe: true)redis_namespace=Redis::Namespace.new(namespace,redis: redis)Split.redis=redis_namespaceend