Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from grpc_health.v1.health_pb2 import HealthCheckRequest, HealthCheckResponse
from grpc_health.v1.health_pb2_grpc import HealthServicer

_SERVING_RESPONSE = HealthCheckResponse(status=HealthCheckResponse.SERVING)

# pylint: enable=E0611


Expand All @@ -31,7 +33,7 @@ def Check(
self, request: HealthCheckRequest, context: grpc.ServicerContext
) -> HealthCheckResponse:
"""Return a HealthCheckResponse with SERVING status."""
return HealthCheckResponse(status=HealthCheckResponse.SERVING)
return _SERVING_RESPONSE

def Watch(self, request: HealthCheckRequest, context: grpc.ServicerContext) -> None:
"""Watch the health status (not implemented)."""
Expand Down