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

Commit bd2d704

Browse files
authored
Merge pull request #276 from ipfs/fix/spawn-in-series
fix: spawn in series
2 parents 6b7a0fd + d976699 commit bd2d704

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/src/utils/spawn.js

Lines changed: 3 additions & 3 deletions
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)