Class: HealthyRack::Checks::Redis

Inherits:
HealthyRack::Check show all
Defined in:
lib/healthy_rack/checks/redis.rb

Instance Method Summary collapse

Methods inherited from HealthyRack::Check

#==, #hash, #name

Constructor Details

#initialize(redis_url) ⇒ Redis

Returns a new instance of Redis.



7
8
9
# File 'lib/healthy_rack/checks/redis.rb', line 7

def initialize(redis_url)
  @redis_url = redis_url
end

Instance Method Details

#callObject



15
16
17
18
19
20
# File 'lib/healthy_rack/checks/redis.rb', line 15

def call
  response = ::Redis.new(url: redis_url).ping
  response == 'PONG'
rescue
  false
end

#verifyObject



11
12
13
# File 'lib/healthy_rack/checks/redis.rb', line 11

def verify
  VerifyClassDefinition.call('Redis')
end