Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
fix(block-service): limit all async calls
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Apr 24, 2016
1 parent a79f650 commit f256451
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/block-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function BlockService (ipfsRepo, exchange) {
return callback(new Error('expects an array of Blocks'))
}

async.each(blocks, (block, next) => {
async.eachLimit(blocks, 100, (block, next) => {
this.addBlock(block, next)
}, callback)
}
Expand Down Expand Up @@ -54,7 +54,7 @@ function BlockService (ipfsRepo, exchange) {

var results = {}

async.each(multihashes, (multihash, next) => {
async.eachLimit(multihashes, 100, (multihash, next) => {
this.getBlock(multihash, extension, (err, block) => {
results[multihash] = {
err: err,
Expand Down Expand Up @@ -90,7 +90,7 @@ function BlockService (ipfsRepo, exchange) {
return callback(new Error('Invalid batch of multihashes'))
}

async.each(multihashes, (multihash, next) => {
async.eachLimit(multihashes, 100, (multihash, next) => {
this.deleteBlock(multihash, extension, next)
}, (err) => {
callback(err)
Expand Down

0 comments on commit f256451

Please sign in to comment.