Sha256: 6b5933718d51295db6775fa852d5c9fe8c594920f7bfede7e9f8d2291503cdc4

Contents?: true

Size: 754 Bytes

Versions: 8

Compression:

Stored size: 754 Bytes

Contents

module GovukHealthcheck
  class SidekiqRedis
    def name
      :redis_connectivity
    end

    def status
      # Sidekiq 7 introduced a default_configuration object which has .redis_info
      # for querying Redis information. If the default_configuration object isn't present,
      # we can fall back to the old method of querying it using 'Sidekiq.redis_info'.
      if Sidekiq.respond_to?(:default_configuration)
        Sidekiq.default_configuration.redis_info ? OK : CRITICAL
      else
        Sidekiq.redis_info ? OK : CRITICAL
      end
    rescue StandardError
      # One would expect a Redis::BaseConnectionError, but this should be
      # critical if any exception is raised when making a call to redis.
      CRITICAL
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
govuk_app_config-9.15.3 lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
govuk_app_config-9.15.2 lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
govuk_app_config-9.15.1 lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
govuk_app_config-9.15.0 lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
govuk_app_config-9.14.6 lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
govuk_app_config-9.14.5 lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
govuk_app_config-9.14.4 lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
govuk_app_config-9.14.3 lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb