Class: HealthCheckToolbox::Services::RedisService

Inherits:
BaseHealthCheck show all
Defined in:
lib/health_check_toolbox/services/redis_service.rb

Constant Summary

Constants inherited from BaseHealthCheck

BaseHealthCheck::STATUS_ERROR, BaseHealthCheck::STATUS_OK

Instance Attribute Summary

Attributes inherited from BaseHealthCheck

#args, #block

Instance Method Summary collapse

Methods inherited from BaseHealthCheck

#build_response, #initialize

Constructor Details

This class inherits a constructor from HealthCheckToolbox::Services::BaseHealthCheck

Instance Method Details

#try_connectObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/health_check_toolbox/services/redis_service.rb', line 9

def try_connect
  build_response(
    begin
      Redis.new.ping
      true
    rescue StandardError
      false
    end
  )
end