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-4.10.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.10.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.9.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.8.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.7.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.7.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.6.3 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.6.2 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.6.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.6.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.5.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.4.3 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.4.2 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.4.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.4.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.3.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.2.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.1.0 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.0.1 lib/govuk_app_config/govuk_healthcheck.rb
govuk_app_config-4.0.0 lib/govuk_app_config/govuk_healthcheck.rb