Class: HealthyRack::Checks::Redis
- Inherits:
-
HealthyRack::Check
- Object
- HealthyRack::Check
- HealthyRack::Checks::Redis
- Defined in:
- lib/healthy_rack/checks/redis.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(redis_url) ⇒ Redis
constructor
A new instance of Redis.
- #verify ⇒ Object
Methods inherited from HealthyRack::Check
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
#call ⇒ Object
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 |
#verify ⇒ Object
11 12 13 |
# File 'lib/healthy_rack/checks/redis.rb', line 11 def verify VerifyClassDefinition.call('Redis') end |