Skip to content

Commit

Permalink
Fix reconnect burst on auth failure
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
  • Loading branch information
Jarema committed Mar 22, 2023
1 parent 49959a5 commit 7e5e9a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion async-nats/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ impl Connector {
}
}
}
self.attempts = 0;

let tls_required = self.options.tls_required || server_addr.tls_required();
let mut connect_info = ConnectInfo {
Expand Down Expand Up @@ -235,6 +234,7 @@ impl Connector {
}
},
Some(_) => {
self.attempts = 0;
self.events_tx.send(Event::Connected).await.ok();
self.state_tx.send(State::Connected).ok();
return Ok((server_info, connection));
Expand Down

0 comments on commit 7e5e9a3

Please sign in to comment.