diff options
author | Jaakko Manninen <jaakko@rocketpack.fi> | 2013-01-31 15:45:36 +0400 |
---|---|---|
committer | Jaakko Manninen <jaakko@rocketpack.fi> | 2013-01-31 15:46:44 +0400 |
commit | a56802f7c001699f2292afeb90dd9bad99391939 (patch) | |
tree | ddb7c13eca06dd43e0308ad8a8bd7699661333d9 | |
parent | 6e228482318d0875999c068740be636ecccf27a7 (diff) |
dont call cb unless defined in unlock, warn if unlocking twicerplockfix
-rw-r--r-- | lib/cache.js | 8 |
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 |