Skip to content

Commit

Permalink
Only retain non-closed subscriptions on reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb committed May 27, 2022
1 parent 05cd043 commit feb2186
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions async-nats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,9 @@ impl ConnectionHandler {
let (_, connection) = self.connector.connect().await?;
self.connection = connection;

self.subscriptions
.retain(|_, subscription| !subscription.sender.is_closed());

for (sid, subscription) in &self.subscriptions {
self.connection
.write_op(ClientOp::Subscribe {
Expand Down

0 comments on commit feb2186

Please sign in to comment.