Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 9ea0cbb

Browse files
authored
Merge pull request #274 from ipfs/fix/pubsub-clear-interval-on-err
fix(pubsub): clear interval on error
2 parents f5ccada + d074e13 commit 9ea0cbb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

js/src/pubsub.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function waitForPeers (ipfs, topic, peersToWait, callback) {
2121
const i = setInterval(() => {
2222
ipfs.pubsub.peers(topic, (err, peers) => {
2323
if (err) {
24+
clearInterval(i)
2425
return callback(err)
2526
}
2627

0 commit comments

Comments
 (0)