added basic passenger support, no long polling but functions

clean up initializers so they are ordered properly
This commit is contained in:
Sam
2013-03-11 05:33:20 -07:00
parent 8a91b96ec7
commit 1c8eef7dbd
8 changed files with 35 additions and 17 deletions

View File

@ -35,6 +35,13 @@ class DiscourseRedis
RailsMultisite::ConnectionManagement.current_db
end
def self.new_redis_store
redis_config = YAML::load(File.open("#{Rails.root}/config/redis.yml"))[Rails.env]
redis_store = ActiveSupport::Cache::RedisStore.new "redis://#{redis_config['host']}:#{redis_config['port']}/#{redis_config['cache_db']}"
redis_store.options[:namespace] = -> { DiscourseRedis.namespace }
redis_store
end
def url
"redis://#{@config['host']}:#{@config['port']}/#{@config['db']}"
end