Class: StandardHealth::HealthController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- StandardHealth::HealthController
- Defined in:
- app/controllers/standard_health/health_controller.rb
Instance Method Summary collapse
-
#alive ⇒ Object
Liveness probe.
-
#ready ⇒ Object
Readiness probe.
Instance Method Details
#alive ⇒ Object
Liveness probe. Returns 200 unconditionally — its only job is to confirm the Rails process is up and routing requests. Anything heavier belongs in /ready.
8 9 10 |
# File 'app/controllers/standard_health/health_controller.rb', line 8 def alive head :ok end |
#ready ⇒ Object
Readiness probe. Runs every registered check and returns:
200 if the rolled-up status is :ok or :degraded
503 if any critical check failed (:unavailable)
15 16 17 18 19 |
# File 'app/controllers/standard_health/health_controller.rb', line 15 def ready result = StandardHealth::Aggregator.call http_status = result[:status] == :unavailable ? :service_unavailable : :ok render json: result, status: http_status end |