GRN2-237: Added DB migration error check to health check (#790)

* Added DB migration error check to health check

* Switch nil to blank
This commit is contained in:
Ahmad Farhat 2019-09-06 17:09:43 -04:00 committed by Jesus Federico
parent b590a5a264
commit d203f43946
1 changed files with 6 additions and 1 deletions

View File

@ -24,11 +24,16 @@ HealthCheck.setup do |config|
config.http_status_for_error_object = 500
# You can customize which checks happen on a standard health check, eg to set an explicit list use:
config.standard_checks = %w(database migrations emailconf)
config.standard_checks = %w(database migrations emailconf db-migration)
# You can set what tests are run with the 'full' or 'all' parameter
config.full_checks = %w(database migrations email cache)
config.add_custom_check('db-migration') do
# any code that returns blank on success and non blank string upon failure
ENV["DB_MIGRATE_FAILED"].blank? ? "" : "Database migration failed"
end
# max-age of response in seconds
# cache-control is public when max_age > 1 and basic_auth_username is not set
# You can force private without authentication for longer max_age by