From d9cd613a4a8970962fbea450857755126d2a0f05 Mon Sep 17 00:00:00 2001 From: Akshar Dave Date: Fri, 3 Nov 2023 15:24:13 -0400 Subject: [PATCH] handle notifyClose --- datafeed/mq.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/datafeed/mq.go b/datafeed/mq.go index 52f1cdc884..322920332a 100644 --- a/datafeed/mq.go +++ b/datafeed/mq.go @@ -175,6 +175,14 @@ func (mq *MQService) startConsumer( }() } + go func() { + notifyCloseError := <-mq.connection.Channel.NotifyClose(make(chan *amqp.Error)) + if notifyCloseError != nil { + mq.logger.Debug("Got notifyCloseError error") + errors <- fmt.Errorf("Connection closed: %v", notifyCloseError) + } + }() + // stop the consumer upon sigterm go func() { <-ctx.Done()