diff --git a/config/initializers/healthcheck.rb b/config/initializers/healthcheck.rb index 0fea1a2..8576eb7 100644 --- a/config/initializers/healthcheck.rb +++ b/config/initializers/healthcheck.rb @@ -3,7 +3,7 @@ Healthcheck.configure do |config| config.success = 200 config.error = 503 - config.verbose = false + config.verbose = true config.route = '/healthcheck' config.method = :get @@ -14,8 +14,15 @@ Healthcheck.configure do |config| # } # -- Checks -- - # config.add_check :database, -> { ActiveRecord::Base.connection.execute('select 1') } - # config.add_check :migrations, -> { ActiveRecord::Migration.check_pending! } + config.add_check :database, -> { ActiveRecord::Base.connection.execute('select 1') } + config.add_check :migrations, -> { ActiveRecord::Migration.check_pending! } # config.add_check :cache, -> { Rails.cache.read('some_key') } # config.add_check :environments, -> { Dotenv.require_keys('ENV_NAME', 'ANOTHER_ENV') } + config.add_check :env, -> { + keys = %W(SALSA_OAUTH_KEY SALSA_OAUTH_SECRET) + keys.each do |key| + puts "checking key" + raise "Env variable #{key} not set" unless ENV.key?(key) + end + } end