闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
290 B

  1. # frozen_string_literal: true
  2. redis_connection = Redis.new(
  3. url: ENV['REDIS_URL'],
  4. driver: :hiredis
  5. )
  6. namespace = ENV.fetch('REDIS_NAMESPACE') { nil }
  7. if namespace
  8. Redis.current = Redis::Namespace.new(namespace, redis: redis_connection)
  9. else
  10. Redis.current = redis_connection
  11. end