mirror of
https://github.com/bower/bower.git
synced 2026-02-12 06:55:04 -05:00
Improve clear of runtime cache.
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user