Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Manninen <jaakko@rocketpack.fi>2013-01-31 15:45:36 +0400
committerJaakko Manninen <jaakko@rocketpack.fi>2013-01-31 15:46:44 +0400
commita56802f7c001699f2292afeb90dd9bad99391939 (patch)
treeddb7c13eca06dd43e0308ad8a8bd7699661333d9
parent6e228482318d0875999c068740be636ecccf27a7 (diff)
dont call cb unless defined in unlock, warn if unlocking twicerplockfix
-rw-r--r--lib/cache.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/cache.js b/lib/cache.js
index 33df21720..acde8bbf7 100644
--- a/lib/cache.js
+++ b/lib/cache.js
@@ -1096,8 +1096,12 @@ function LockFile(path) {
LockFile.prototype.unlock = function(cb) {
var self = this
- if (!this.locked)
- return cb()
+ if (!this.locked) {
+ console.trace()
+ console.warn('LockFile.unlock() called twice for '+this.path)
+ if (cb) cb()
+ return
+ }
lockFile.unlock(this.path, function(er) {
self.locked = false