feat(docreader): add health check

This commit is contained in:
wizardchen
2025-09-10 20:12:37 +08:00
committed by lyingbug
parent 8a2b38da6f
commit 6f6ca84dae
4 changed files with 22 additions and 1 deletions
+7 -1
View File
@@ -6,6 +6,8 @@ import traceback
import grpc
import uuid
import atexit
from grpc_health.v1 import health_pb2_grpc
from grpc_health.v1.health import HealthServicer
# Add parent directory to Python path
current_dir = os.path.dirname(os.path.abspath(__file__))
@@ -348,9 +350,13 @@ def serve():
],
)
# Register service
# Register services
docreader_pb2_grpc.add_DocReaderServicer_to_server(DocReaderServicer(), server)
# Register health check service
health_servicer = HealthServicer()
health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server)
# Set listen address
server.add_insecure_port(f"[::]:{port}")