Fixes MediaCacheRefresher, it wasn't checking if there was an IMedia cache

This commit is contained in:
Shannon
2018-08-28 16:50:56 +10:00
parent e1e435cc33
commit 61c52913dd

View File

@@ -47,15 +47,17 @@ namespace Umbraco.Web.Cache
if (anythingChanged)
{
var mediaCache = CacheHelper.IsolatedRuntimeCache.GetCache<IMedia>();
Current.ApplicationCache.ClearPartialViewCache();
var mediaCache = CacheHelper.IsolatedRuntimeCache.GetCache<IMedia>();
foreach (var payload in payloads)
{
if (payload.ChangeTypes == TreeChangeTypes.Remove)
_idkMap.ClearCache(payload.Id);
if (!mediaCache) continue;
// repository cache
// it *was* done for each pathId but really that does not make sense
// only need to do it for the current media