Skip to content

Commit

Permalink
handle notifyClose
Browse files Browse the repository at this point in the history
  • Loading branch information
akshar committed Nov 3, 2023
1 parent 0edec90 commit d9cd613
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions datafeed/mq.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d9cd613

Please sign in to comment.