Improve clear of runtime cache.

This commit is contained in:
André Cruz
2013-07-06 14:56:13 +01:00
parent e51827bfcd
commit 9517191e35
3 changed files with 14 additions and 3 deletions

View File

@@ -273,6 +273,16 @@ ResolveCache.prototype.list = function () {
// ------------------------
ResolveCache.clearRuntimeCache = function () {
// Note that _cache refers to the static _cache variable
// that holds other caches per dir!
// Do not confuse it with the instance cache
// Clear cache of each directory
this._cache.forEach(function (cache) {
cache.reset();
});
// Clear root cache
this._cache.reset();
};

View File

@@ -331,6 +331,7 @@ GitResolver.branches = function (source) {
};
GitResolver.clearRuntimeCache = function () {
// Reset cache for branches, tags, etc
mout.object.forOwn(GitResolver._cache, function (lru) {
lru.reset();
});