Skip to content

Commit

Permalink
updates app/actions/nodeNetworkActions.js
Browse files Browse the repository at this point in the history
  • Loading branch information
comountainclimber committed Jan 11, 2019
1 parent 71acd74 commit 2f6f7c0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/actions/nodeNetworkActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const pingNodes = (nodes: Array<any>) => {
let url = node.protocol ? `${node.protocol}://${node.url}` : node.url
url = node.port ? `${url}:${node.port}` : url

const maxWaitTimer = setTimeout(() => {
resolve(responses)
}, RPC_PING_OVERRIDE)

const client = new rpc.RPCClient(url)
client
.ping()
Expand All @@ -33,13 +37,11 @@ const pingNodes = (nodes: Array<any>) => {
})
}
if (responses.length === nodes.length) {
clearTimeout(maxWaitTimer)
resolve(responses)
}
})
.catch(console.error)
setTimeout(() => {
resolve(responses)
}, RPC_PING_OVERRIDE)
})
})
}
Expand Down

0 comments on commit 2f6f7c0

Please sign in to comment.