feat: implement grpc health service checking database connection (#4499)

This commit is contained in:
Amir Ehsandar
2025-03-14 04:13:01 +03:30
committed by GitHub
parent fc7dc58720
commit e75ef0964d
2 changed files with 25 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/labstack/echo/v4/middleware"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/reflection"
v1pb "github.com/usememos/memos/proto/gen/api/v1"
@@ -19,6 +20,8 @@ import (
)
type APIV1Service struct {
grpc_health_v1.UnimplementedHealthServer
v1pb.UnimplementedWorkspaceServiceServer
v1pb.UnimplementedWorkspaceSettingServiceServer
v1pb.UnimplementedAuthServiceServer
@@ -46,6 +49,7 @@ func NewAPIV1Service(secret string, profile *profile.Profile, store *store.Store
Store: store,
grpcServer: grpcServer,
}
grpc_health_v1.RegisterHealthServer(grpcServer, apiv1Service)
v1pb.RegisterWorkspaceServiceServer(grpcServer, apiv1Service)
v1pb.RegisterWorkspaceSettingServiceServer(grpcServer, apiv1Service)
v1pb.RegisterAuthServiceServer(grpcServer, apiv1Service)