Sha256: dda543d21ed40deeb0b5230a9d746b232ab9642fb9395dc97e096fcf1324c097

Contents?: true

Size: 679 Bytes

Versions: 89

Compression:

Stored size: 679 Bytes

Contents

require "govuk_app_config/govuk_healthcheck/checkup"
require "govuk_app_config/govuk_healthcheck/active_record"
require "govuk_app_config/govuk_healthcheck/mongoid"
require "govuk_app_config/govuk_healthcheck/rails_cache"
require "govuk_app_config/govuk_healthcheck/redis"
require "govuk_app_config/govuk_healthcheck/sidekiq_redis"
require "json"

module GovukHealthcheck
  def self.rack_response(*checks)
    proc do
      checkup = healthcheck(checks)
      [
        checkup[:status] == :ok ? 200 : 500,
        { "Content-Type" => "application/json" },
        [JSON.dump(checkup)],
      ]
    end
  end

  def self.healthcheck(checks)
    Checkup.new(checks).run
  end
end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
govuk_app_config-3.3.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-3.2.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.0.0.pre.4 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.0.0.pre.3 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.0.0.pre.2 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.0.0.pre.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-3.1.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-3.1.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-3.0.0 lib/govuk_app_config/govuk_healthcheck.rb