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

Commit

Permalink
More efficient multi-load prevention
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jan 19, 2011
1 parent 6f550b7 commit a983c81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ npm.load = function (conf, cb_) {
loading = true
function cb (er) {
loaded = true
while (loadListeners.length > 0) {
loadListeners.shift()(er, npm)
}
loadListeners.forEach(function (cb) {
process.nextTick(function () { cb(er, npm) })
})
loadListeners.length = 0
}
log.waitForConfig()
which(process.argv[0], function (er, node) {
Expand Down

0 comments on commit a983c81

Please sign in to comment.