Class: Gruf::Controllers::HealthController
- Defined in:
- lib/gruf/controllers/health_controller.rb
Overview
Dynamic standard grpc health check controller. Can be used as-is, or can use ::Gruf.health_check_hook to provide custom responses.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
bind, #call, #initialize, #process_action
Methods included from Errors::Helpers
Constructor Details
This class inherits a constructor from Gruf::Controllers::Base
Instance Method Details
#check ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/gruf/controllers/health_controller.rb', line 29 def check health_proc = ::Gruf.health_check_hook return health_proc.call(request, error) if !health_proc.nil? && health_proc.respond_to?(:call) ::Grpc::Health::V1::HealthCheckResponse.new( status: ::Grpc::Health::V1::HealthCheckResponse::ServingStatus::SERVING ) end |