Permalink
Browse files

Do not try other cacheName if in the middle of the resolve process.

  • Loading branch information...
1 parent 624886b commit 0440e6916b97c120d1a9eff706c1c9a65d95ab3c @satazor satazor committed Apr 27, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/core/package.js
View
5 lib/core/package.js
@@ -856,8 +856,9 @@ Package.prototype.generateResourceId = function () {
this.resourceId = crypto.createHash('md5').update(this.gitUrl).digest('hex');
this.gitPath = path.join(config.cache, this.cacheName, this.resourceId);
- // If the cache folder does not exists, try guessing it again from the new gitUrl
- if (!fs.existsSync(this.gitPath)) {
+ // If we are not in the middle of the resolve process and if the cache folder
+ // does not exists, try guessing it again from the new gitUrl
+ if (!this.unitWork.isLocked(this.cacheName) && !fs.existsSync(this.gitPath)) {
this.cacheName = this.guessName(this.cacheName);
this.gitPath = path.join(config.cache, this.cacheName, this.resourceId);
}

0 comments on commit 0440e69

Please sign in to comment.