Class: Rubino::API::Operations::HealthOperation
- Inherits:
-
Object
- Object
- Rubino::API::Operations::HealthOperation
- Defined in:
- lib/rubino/api/operations/health_operation.rb
Overview
GET /v1/health — readiness probe. No auth required (allowlisted in Middleware::Auth::SKIP_PATHS).
Pings the database and reports scheduler status alongside build info. Returns 503 if any critical dependency is degraded; never raises.
Instance Method Summary collapse
Instance Method Details
#call(_request = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/rubino/api/operations/health_operation.rb', line 14 def call(_request = nil) deps = { db: db_status, scheduler: scheduler_status } status = deps.values.all? { |s| s[:status] == "ok" } ? 200 : 503 [status, { status: status == 200 ? "ok" : "degraded", version: Rubino::VERSION, deps: deps }] end |