Skip to content

Commit

Permalink
fix: fix grpc.serve block bug (#5430)
Browse files Browse the repository at this point in the history
  • Loading branch information
derecknowayback authored Oct 13, 2023
1 parent ebcf4c9 commit f3abe1a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/lorry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ func main() {
if err != nil {
panic(fmt.Errorf("fatal error listen on port %d: %v", grpcPort, err))
}

healthServer := customgrpc.NewGRPCServer()
server := grpc.NewServer()
health.RegisterHealthServer(server, healthServer)

err = server.Serve(listen)
if err != nil {
panic(fmt.Errorf("fatal error grpcserver serve failed: %v", err))
}
go func() {
err = server.Serve(listen)
if err != nil {
panic(fmt.Errorf("fatal error grpcserver serve failed: %v", err))
}
}()

// ha dependent on dbmanager which is initialized by rt.Run
logHa := ctrl.Log.WithName("HA")
Expand Down

0 comments on commit f3abe1a

Please sign in to comment.