Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook up minder healthcheck to database health #1590

Merged
merged 4 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
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
11 changes: 6 additions & 5 deletions internal/controlplane/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ package controlplane
import (
"context"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

pb "github.com/stacklok/minder/pkg/api/protobuf/go/minder/v1"
)

// PaginationLimit is the maximum number of items that can be returned in a single page
const PaginationLimit = 10

// CheckHealth is a simple health check for monitoring
// The lintcheck is disabled because the unused-receiver is required by
// the implementation. UnimplementedHealthServiceServer is initialized
// within the Server struct
//
//revive:disable:unused-receiver
func (s *Server) CheckHealth(_ context.Context, _ *pb.CheckHealthRequest) (*pb.CheckHealthResponse, error) {
if err := s.store.CheckHealth(); err != nil {
return nil, status.Errorf(codes.Internal, "failed to check health: %v", err)
}
return &pb.CheckHealthResponse{Status: "OK"}, nil
}
Loading