Class: HealthCheck::RedisHealthCheck
- Inherits:
-
Object
- Object
- HealthCheck::RedisHealthCheck
- Extended by:
- BaseHealthCheck
- Defined in:
- lib/health_check/redis_health_check.rb
Class Method Summary collapse
Methods included from BaseHealthCheck
Class Method Details
.check ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/health_check/redis_health_check.rb', line 8 def check raise "Wrong configuration. Missing 'redis' gem" unless defined?(::Redis) client.ping == 'PONG' ? '' : "Redis.ping returned #{res.inspect} instead of PONG" rescue Exception => err create_error 'redis', err. ensure client.close if client.connected? end |
.client ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/health_check/redis_health_check.rb', line 18 def client @client ||= Redis.new( { url: HealthCheck.redis_url, password: HealthCheck.redis_password }.reject { |k, v| v.nil? } ) end |