Skip to content

Commit

Permalink
Close GRPCBroker on GRPCServer GracefulStop as well
Browse files Browse the repository at this point in the history
  • Loading branch information
bflad committed Nov 8, 2022
1 parent 0eca584 commit 3d6322f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,22 @@ func (s *GRPCServer) Init() error {
// Stop calls Close on the underlying grpc.Broker and Stop on the underlying
// grpc.Server
func (s *GRPCServer) Stop() {
s.server.Stop()

if s.broker != nil {
s.broker.Close()
s.broker = nil
}
s.server.Stop()
}

// GracefulStop calls GracefulStop on the underlying grpc.Server
func (s *GRPCServer) GracefulStop() {
s.server.GracefulStop()

if s.broker != nil {
s.broker.Close()
s.broker = nil
}
}

// Config is the GRPCServerConfig encoded as JSON then base64.
Expand Down

0 comments on commit 3d6322f

Please sign in to comment.