Update grpc server with logging statements

This commit is contained in:
Devoalda 2023-10-31 19:52:20 +08:00
parent 6b59bc2c28
commit c491ace792
1 changed files with 2 additions and 0 deletions

View File

@ -91,6 +91,7 @@ class Dynamo(pb2_grpc.Dynamo_DBServicer):
if not hex_pattern.match(request.file_hash): if not hex_pattern.match(request.file_hash):
return pb2.Response(is_exist=False) return pb2.Response(is_exist=False)
else: else:
print(f"Checking file {request.file_hash} with hash signature {request.file_hash}")
length = len(request.file_hash) length = len(request.file_hash)
if length == 64: if length == 64:
print("check sha256") print("check sha256")
@ -112,6 +113,7 @@ def serve():
server.add_insecure_port('[::]:50051') server.add_insecure_port('[::]:50051')
server.start() server.start()
print("Server started at 50051")
server.wait_for_termination() server.wait_for_termination()