Browse Source

only close channels if they aren't already

pull/6/head v0.5.1
lane-c-wagner 5 years ago
parent
commit
2082f1141a
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      channel.go

+ 12
- 2
channel.go View File

@ -66,8 +66,18 @@ func (chManager *channelManager) startNotifyCancelOrClosed() {
chManager.logger.Printf("successfully reconnected to amqp server after cancel")
chManager.notifyCancelOrClose <- errors.New(err)
}
close(notifyCancelChan)
close(notifyCloseChan)
// these channels can be closed by amqp
select {
case <-notifyCloseChan:
default:
close(notifyCloseChan)
}
select {
case <-notifyCancelChan:
default:
close(notifyCancelChan)
}
}
// reconnectWithBackoff continuously attempts to reconnect with an


Loading…
Cancel
Save