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

Commit

Permalink
fix(pubsub): clear interval on error
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw committed May 17, 2018
1 parent f5ccada commit d074e13
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions js/src/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function waitForPeers (ipfs, topic, peersToWait, callback) {
const i = setInterval(() => {
ipfs.pubsub.peers(topic, (err, peers) => {
if (err) {
clearInterval(i)
return callback(err)
}

Expand Down

0 comments on commit d074e13

Please sign in to comment.