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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user