[VOL-1914] Responding to Reboot call before shutting down the gRPC server
Change-Id: I6cf618a7780eee02c41b4e4a9285277bab90bdd6
diff --git a/internal/bbsim/devices/olt.go b/internal/bbsim/devices/olt.go
index 6484896..ce64b4e 100644
--- a/internal/bbsim/devices/olt.go
+++ b/internal/bbsim/devices/olt.go
@@ -703,9 +703,11 @@
}
func (o OltDevice) Reboot(context.Context, *openolt.Empty) (*openolt.Empty, error) {
- oltLogger.Info("Shutting Down")
- close(*o.oltDoneChannel)
- close(*o.apiDoneChannel)
+ defer func() {
+ oltLogger.Info("Shutting Down")
+ close(*o.oltDoneChannel)
+ close(*o.apiDoneChannel)
+ }()
return new(openolt.Empty), nil
}