Skip to content

Instantly share code, notes, and snippets.

@aep
Created December 7, 2014 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aep/608b980a5cfd2b36d86f to your computer and use it in GitHub Desktop.
Save aep/608b980a5cfd2b36d86f to your computer and use it in GitHub Desktop.
redis_config = YAML.load_file(File.join(Rails.root, 'config/redis.yml'))[Rails.env]
REDIS_MQTT_DB = ConnectionPool::Wrapper.new(size: redis_config['pool'], timeout: 3) do
Redis.new(:host => redis_config['host'], :port => redis_config['port'], :db => redis_config['mqtt_db'])
end
REDIS_SESSION_DB = ConnectionPool::Wrapper.new(size: redis_config['pool'], timeout: 3) do
Redis.new(:host => redis_config['host'], :port => redis_config['port'], :db => redis_config['session_time_db'])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment