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



289
290
291
292
# File 'lib/brainzlab/utilities/health_check.rb', line 289

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

#readyObject



294
295
296
297
298
299
# File 'lib/brainzlab/utilities/health_check.rb', line 294

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



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

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