Skip to content

Commit

Permalink
Merge pull request #21 from ryan961/main
Browse files Browse the repository at this point in the history
fix: subscriber.ch isn't closed in the event of unexpected disconnection.
  • Loading branch information
tx7do committed Sep 14, 2022
2 parents 2f9eed1 + b31a12f commit 47a0599
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions broker/rabbitmq/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ func (r *rabbitConnection) reconnect(secure bool, config *amqp.Config) {
r.Unlock()
case err := <-notifyClose:
log.Error(err)

select {
case errs := <-chanNotifyClose:
log.Error(errs)
case <-time.After(time.Second):
}

r.Lock()
r.connected = false
r.waitConnection = make(chan struct{})
Expand Down

0 comments on commit 47a0599

Please sign in to comment.