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-9.16.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.16.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.8 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.7 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.6 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.5 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.4 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.3 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.2 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.15.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.14.6 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.14.5 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.14.4 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.14.3 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.14.2 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.14.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.14.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.13.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-9.13.0 lib/govuk_app_config/govuk_healthcheck.rb