From df43b87f434dcfdad299b4424d76b274e770d215 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 23 Jun 2021 11:31:08 +0200 Subject: [PATCH] https://github.com/umbraco/Umbraco-CMS/issues/10394 - Fixes issue with "Rebuild" not really doing anything, because the "null" injected was not handled like "All", but instead ignored the type. --- .../Persistence/NuCacheContentRepository.cs | 17 +++-------------- .../Persistence/NuCacheContentService.cs | 16 +++------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs index bfde5c07bc..a3b37b1d00 100644 --- a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs +++ b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs @@ -101,20 +101,9 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence IReadOnlyCollection mediaTypeIds = null, IReadOnlyCollection memberTypeIds = null) { - if (contentTypeIds != null) - { - RebuildContentDbCache(groupSize, contentTypeIds); - } - - if (mediaTypeIds != null) - { - RebuildContentDbCache(groupSize, mediaTypeIds); - } - - if (memberTypeIds != null) - { - RebuildContentDbCache(groupSize, memberTypeIds); - } + RebuildContentDbCache(groupSize, contentTypeIds); + RebuildContentDbCache(groupSize, mediaTypeIds); + RebuildContentDbCache(groupSize, memberTypeIds); } // assumes content tree lock diff --git a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentService.cs b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentService.cs index 2308b6eab8..32f7c83f9d 100644 --- a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentService.cs +++ b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentService.cs @@ -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); - } + scope.ReadLock(Constants.Locks.ContentTree); + scope.ReadLock(Constants.Locks.MediaTree); + scope.ReadLock(Constants.Locks.MemberTree); _repository.Rebuild(groupSize, contentTypeIds, mediaTypeIds, memberTypeIds); scope.Complete();