Skip to content

Commit

Permalink
feat: add default health check handler to grpc server
Browse files Browse the repository at this point in the history
The default health check handler is added to the grpc server as part of the gRPC service implementation for Dapr. This change adds the function `defaultHealthCheckHandler()` which returns `nil` when called, and updates `newServer()` function to include `healthCheckHandler` as a field in the struct.
  • Loading branch information
shumkovdenis committed May 18, 2023
1 parent 8ea3045 commit d38452e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import (
"github.com/dapr/go-sdk/service/common"
)

func defaultHealthCheckHandler(ctx context.Context) error {
return nil
}

// server is the gRPC service implementation for Dapr.
type server struct {
pb.UnimplementedAppCallbackHealthCheckServer
Expand All @@ -25,7 +29,8 @@ type server struct {

func newServer(lis net.Listener, opts ...grpc.ServerOption) *server {
s := &server{
listener: lis,
listener: lis,
healthCheckHandler: defaultHealthCheckHandler,
}

gs := grpc.NewServer(opts...)
Expand Down

0 comments on commit d38452e

Please sign in to comment.