lib/plezi/common/redis.rb in plezi-0.10.15 vs lib/plezi/common/redis.rb in plezi-0.10.16

- old
+ new

@@ -8,11 +8,11 @@ # A Redis connection will be automatically created if the `ENV['PL_REDIS_URL']` is set. # for example: # ENV['PL_REDIS_URL'] = ENV['REDISCLOUD_URL']` # or # ENV['PL_REDIS_URL'] = "redis://username:password@my.host:6379" - def redis_connection + def redis return @redis if (@redis_sub_thread && @redis_sub_thread.alive?) && @redis return false unless defined?(Redis) && ENV['PL_REDIS_URL'] @redis_locker ||= Mutex.new @redis_locker.synchronize do return @redis if (@redis_sub_thread && @redis_sub_thread.alive?) && @redis # repeat the test once syncing is done. @@ -45,7 +45,8 @@ @redis rescue => e Reactor.error e false end + alias :redis_connection :redis end