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

Commit d976699

Browse files
committed
fix: spawn in series
Pending resolution of ipfs/js-ipfsd-ctl#253 License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
1 parent 6b7a0fd commit d976699

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/src/utils/spawn.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const waterfall = require('async/waterfall')
2-
const times = require('async/times')
2+
const timesSeries = require('async/timesSeries')
33

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

1818
// Spawn n nodes
1919
function spawnNodes (n, factory, callback) {
20-
times(n, (_, cb) => factory.spawnNode(cb), callback)
20+
timesSeries(n, (_, cb) => factory.spawnNode(cb), callback)
2121
}
2222

2323
exports.spawnNodes = spawnNodes
2424

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

3030
exports.spawnNodesWithId = spawnNodesWithId

0 commit comments

Comments
 (0)