Skip to content

Commit

Permalink
fix: clear healtcheck on reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-pousette committed Dec 13, 2023
1 parent 0888f53 commit 035d47c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/transport/stream/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,12 @@ export abstract class DirectStream<
): PeerStreams {
const publicKeyHash = publicKey.hashcode();

const hc = this.healthChecks.get(publicKeyHash);
if (hc) {
clearTimeout(hc);
this.healthChecks.delete(publicKeyHash);
}

const existing = this.peers.get(publicKeyHash);

// If peer streams already exists, do nothing
Expand Down

0 comments on commit 035d47c

Please sign in to comment.