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

Commit

Permalink
fix: spawn in series
Browse files Browse the repository at this point in the history
Pending resolution of ipfs/js-ipfsd-ctl#253

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw committed May 18, 2018
1 parent 6b7a0fd commit d976699
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/src/utils/spawn.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const waterfall = require('async/waterfall')
const times = require('async/times')
const timesSeries = require('async/timesSeries')

// Spawn a node, get it's id and set it as `peerId` on the node
function spawnNodeWithId (factory, callback) {
Expand All @@ -17,14 +17,14 @@ exports.spawnNodeWithId = spawnNodeWithId

// Spawn n nodes
function spawnNodes (n, factory, callback) {
times(n, (_, cb) => factory.spawnNode(cb), callback)
timesSeries(n, (_, cb) => factory.spawnNode(cb), callback)
}

exports.spawnNodes = spawnNodes

// Spawn n nodes, getting their id's and setting them as `peerId` on the nodes
function spawnNodesWithId (n, factory, callback) {
times(n, (_, cb) => spawnNodeWithId(factory, cb), callback)
timesSeries(n, (_, cb) => spawnNodeWithId(factory, cb), callback)
}

exports.spawnNodesWithId = spawnNodesWithId

0 comments on commit d976699

Please sign in to comment.