Merge pull request #10519 from umbraco/v9/bugfix/10394_nucache_rebuild_issue

V9: Fixes issue with "Rebuild" nucache not doing anything
This commit is contained in:
Warren Buckley
2021-06-23 13:33:58 +01:00
committed by GitHub
2 changed files with 6 additions and 27 deletions

View File

@@ -100,22 +100,11 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence
IReadOnlyCollection<int> contentTypeIds = null,
IReadOnlyCollection<int> mediaTypeIds = null,
IReadOnlyCollection<int> memberTypeIds = null)
{
if (contentTypeIds != null)
{
RebuildContentDbCache(groupSize, contentTypeIds);
}
if (mediaTypeIds != null)
{
RebuildContentDbCache(groupSize, mediaTypeIds);
}
if (memberTypeIds != null)
{
RebuildContentDbCache(groupSize, memberTypeIds);
}
}
// assumes content tree lock
private void RebuildContentDbCache(int groupSize, IReadOnlyCollection<int> contentTypeIds)

View File

@@ -79,20 +79,10 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence
{
using (IScope scope = ScopeProvider.CreateScope(repositoryCacheMode: RepositoryCacheMode.Scoped))
{
if (contentTypeIds != null)
{
scope.ReadLock(Constants.Locks.ContentTree);
}
if (mediaTypeIds != null)
{
scope.ReadLock(Constants.Locks.MediaTree);
}
if (memberTypeIds != null)
{
scope.ReadLock(Constants.Locks.MemberTree);
}
_repository.Rebuild(groupSize, contentTypeIds, mediaTypeIds, memberTypeIds);
scope.Complete();