Skip to content

Commit

Permalink
Ensure sync plugins are ran async to mitigate stack overflows
Browse files Browse the repository at this point in the history
  • Loading branch information
confuser committed Dec 9, 2015
1 parent 03273b9 commit c7c63dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/load-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function (plugins, dependencies, cb) {
function pluginIterator(cb) {
var missingDependency = true

async.each(plugins, function (plugin, eachCb) {
async.each(plugins, async.ensureAsync(function (plugin, eachCb) {
// Skip if loaded
if (loadedPlugins.indexOf(plugin.name) !== -1) return eachCb()

Expand All @@ -38,7 +38,7 @@ module.exports = function (plugins, dependencies, cb) {
eachCb()
}

} , function (error) {
}) , function (error) {
if (error) return cb(error)
if (!missingDependency) return cb()

Expand Down

0 comments on commit c7c63dd

Please sign in to comment.