Class: BrainzLab::Utilities::HealthCheck::HealthController

Inherits:
ActionController::API
  • Object
show all
Defined in:
lib/brainzlab/utilities/health_check.rb

Instance Method Summary collapse

Instance Method Details

#liveObject



279
280
281
282
# File 'lib/brainzlab/utilities/health_check.rb', line 279

def live
  # Liveness probe - just check if the app is running
  render json: { status: 'ok', timestamp: Time.now.utc.iso8601 }
end

#readyObject



284
285
286
287
288
289
# File 'lib/brainzlab/utilities/health_check.rb', line 284

def ready
  # Readiness probe - check critical dependencies
  result = HealthCheck.run(checks: %i[database redis])
  status = result[:status] == 'healthy' ? :ok : :service_unavailable
  render json: result, status: status
end

#showObject



273
274
275
276
277
# File 'lib/brainzlab/utilities/health_check.rb', line 273

def show
  result = HealthCheck.run
  status = result[:status] == 'healthy' ? :ok : :service_unavailable
  render json: result, status: status
end