Skip to content

Commit

Permalink
fix to close deprecated connections on the reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris-Plato committed Feb 28, 2024
1 parent fb560ec commit 7ba88cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _examples/pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func publish(sessions chan chan session, messages <-chan message) {
select {
case confirmed, ok := <-confirm:
if !ok {
pub.Close()
break Publish
}
if !confirmed.Ack {
Expand Down Expand Up @@ -191,6 +192,7 @@ func subscribe(sessions chan chan session, messages chan<- message) {
messages <- msg.Body
sub.Ack(msg.DeliveryTag, false)
}
sub.Close()
}
}

Expand Down

0 comments on commit 7ba88cc

Please sign in to comment.