fix for controller shutdown when amqpSource is in reconnecting state (#344)

This commit is contained in:
Michael Quigley 2023-06-09 12:05:02 -04:00
parent 459e0e60a1
commit 368ddf5f01
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -81,8 +81,10 @@ func (s *amqpSource) Start(events chan ZitiEventMsg) (join chan struct{}, err er
}
func (s *amqpSource) Stop() {
if err := s.ch.Close(); err != nil {
logrus.Error(err)
if s.ch != nil {
if err := s.ch.Close(); err != nil {
logrus.Error(err)
}
}
close(s.join)
}