lib/hyrax/redis_event_store.rb in hyrax-5.0.0.rc1 vs lib/hyrax/redis_event_store.rb in hyrax-5.0.0.rc2
- old
+ new
@@ -23,18 +23,17 @@
# @note this is NOT a singleton-ilke `.instance` method, it returns a
# `Redis` client.
#
# @return [Redis]
def instance
- connection = Hyrax.config.redis_connection || Redis.current
-
- if connection.is_a? Redis::Namespace
- connection.namespace = namespace
- connection
- elsif connection == Redis.current
- Redis.current = Redis::Namespace.new(namespace, redis: connection)
+ if Hyrax.config.redis_connection&.is_a?(Redis::Namespace)
+ c = Hyrax.config.redis_connection
+ c.namespace = namespace
+ c
+ elsif Hyrax.config.redis_connection
+ Hyrax.config.redis_connection
else
- connection
+ Redis::Namespace.new(namespace, redis: Redis.new)
end
end
##
# @api private