Skip to content

Commit

Permalink
dont use too many FDs
Browse files Browse the repository at this point in the history
  • Loading branch information
yocontra committed May 7, 2018
1 parent fce6fe5 commit 920dc2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ exports.default = function (_ref) {
onBoundary: onBoundary
};

_async2.default.forEach(options.objects, _async2.default.ensureAsync(processObject.bind(null, context)), onFinish);
_async2.default.forEachSeries(options.objects, _async2.default.ensureAsync(processObject.bind(null, context)), onFinish);
});
};

Expand All @@ -96,7 +96,7 @@ function processObject(context, object, cb) {
fetchObjectFiles(context, object, function (err, filePaths) {
if (err) return cb(err);
debug(_chalk2.default.bold('Processing ' + filePaths.length + ' boundary ' + (0, _plural2.default)('file', filePaths.length) + ' for ' + object));
_async2.default.forEach(filePaths, _async2.default.ensureAsync(processFilePath.bind(null, context)), cb);
_async2.default.forEachSeries(filePaths, _async2.default.ensureAsync(processFilePath.bind(null, context)), cb);
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "census-boundaries",
"version": "2.0.3",
"version": "2.0.4",
"description": "Downloads and converts US Census TIGER data representing all boundaries in the United States",
"main": "dist/index.js",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default ({ objects, onBoundary, onFinish }) => {
onBoundary
}

async.forEach(options.objects, async.ensureAsync(processObject.bind(null, context)), onFinish)
async.forEachSeries(options.objects, async.ensureAsync(processObject.bind(null, context)), onFinish)
})
}

Expand All @@ -42,7 +42,7 @@ function processObject(context, object, cb) {
fetchObjectFiles(context, object, (err, filePaths) => {
if (err) return cb(err)
debug(chalk.bold(`Processing ${filePaths.length} boundary ${plural('file', filePaths.length)} for ${object}`))
async.forEach(filePaths, async.ensureAsync(processFilePath.bind(null, context)), cb)
async.forEachSeries(filePaths, async.ensureAsync(processFilePath.bind(null, context)), cb)
})
}

Expand Down

0 comments on commit 920dc2c

Please sign in to comment.