Sha256: a51be6b42ca6bc1c2b57fdd78e083d717d078e610808715dbc5f8accaf0a794d

Contents?: true

Size: 397 Bytes

Versions: 93

Compression:

Stored size: 397 Bytes

Contents

require "securerandom"

module GovukHealthcheck
  class Redis
    def name
      :redis_connectivity
    end

    def status
      client = ::Redis.new

      key = "healthcheck-#{SecureRandom.hex}"

      client.set(key, "val")
      client.get(key)
      client.del(key)

      client.close

      GovukHealthcheck::OK
    rescue StandardError
      GovukHealthcheck::CRITICAL
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
govuk_app_config-9.0.2 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-9.0.1 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-9.0.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-8.1.1 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-8.1.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-8.0.2 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-8.0.1 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-8.0.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-7.2.1 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-7.2.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-7.1.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-7.0.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-6.0.1 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-6.0.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-5.1.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-5.0.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-4.13.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-4.12.0 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-4.11.1 lib/govuk_app_config/govuk_healthcheck/redis.rb
govuk_app_config-4.11.0 lib/govuk_app_config/govuk_healthcheck/redis.rb