Fixes RepositoryBase.Get to not use a GetOrAdd with the IRuntimeCache and instead just use a linear lookup, set cache, return - this causes less confusion and also prevents any inner recursive key lookups within our cache which was causing YSODs. Added tests for the RepositoryBase's DeepCloneRuntimeCacheProvider (see code comment about what this does), updates other repo's to use the RuntimeCache property instead of accessing it via the RepositoryCache.RuntimeCache property.

This commit is contained in:
Shannon
2015-05-21 17:04:14 +10:00
parent 260ec800c2
commit a94f7e6ec0
9 changed files with 182 additions and 59 deletions

View File

@@ -216,6 +216,7 @@ namespace Umbraco.Core.Cache
var policy = GetPolicy(timeout, isSliding, removedCallback, dependentFiles);
lck.UpgradeToWriteLock();
//NOTE: This does an add or update
MemoryCache.Set(cacheKey, result, policy);
}
}
@@ -242,6 +243,7 @@ namespace Umbraco.Core.Cache
if (value == null) return; // do not store null values (backward compat)
var policy = GetPolicy(timeout, isSliding, removedCallback, dependentFiles);
//NOTE: This does an add or update
MemoryCache.Set(cacheKey, result, policy);
}