Merge commit '94d525d88f713b36419f28bfda4d82ee68637d83' into v9/dev

# Conflicts:
#	build/NuSpecs/UmbracoCms.Web.nuspec
#	src/Umbraco.Core/Composing/Current.cs
#	src/Umbraco.Core/Persistence/NPocoDatabaseExtensions-Bulk.cs
#	src/Umbraco.Core/Runtime/CoreRuntime.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/Persistence/NPocoDatabaseExtensions.cs
#	src/Umbraco.Infrastructure/Persistence/UmbracoDatabase.cs
#	src/Umbraco.Persistence.SqlCe/SqlCeSyntaxProvider.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/BTree.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/ContentCacheDataModel.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/ContentCacheDataSerializationResult.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/ContentCacheDataSerializerEntityType.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/ContentNestedData.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/CultureVariation.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/IContentCacheDataSerializer.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/IContentCacheDataSerializerFactory.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/IDictionaryOfPropertyDataSerializer.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/JsonContentNestedDataSerializer.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/JsonContentNestedDataSerializerFactory.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/LazyCompressedString.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/MsgPackContentNestedDataSerializer.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/MsgPackContentNestedDataSerializerFactory.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/PropertyData.cs
#	src/Umbraco.PublishedCache.NuCache/NuCacheSerializerComponent.cs
#	src/Umbraco.PublishedCache.NuCache/NuCacheSerializerComposer.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs
#	src/Umbraco.Tests/App.config
#	src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs
#	src/Umbraco.Tests/PublishedContent/NuCacheTests.cs
#	src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI/web.Template.Debug.config
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/Composing/ModuleInjector.cs
#	src/Umbraco.Web/Editors/NuCacheStatusController.cs
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/ContentNestedData.cs
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs
#	src/Umbraco.Web/PublishedCache/NuCache/NuCacheComposer.cs
#	src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
#	src/Umbraco.Web/Runtime/WebRuntime.cs
This commit is contained in:
Shannon
2021-06-24 09:43:57 -06:00
parent 4c89d036ac
commit 72671dbca8
139 changed files with 5650 additions and 1593 deletions

View File

@@ -46,6 +46,8 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
private readonly IPublishedModelFactory _publishedModelFactory;
private readonly IDefaultCultureAccessor _defaultCultureAccessor;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IContentCacheDataSerializerFactory _contentCacheDataSerializerFactory;
private readonly ContentDataSerializer _contentDataSerializer;
private readonly NuCacheSettings _config;
private bool _isReady;
@@ -90,7 +92,9 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
IOptions<GlobalSettings> globalSettings,
IPublishedModelFactory publishedModelFactory,
IHostingEnvironment hostingEnvironment,
IOptions<NuCacheSettings> config)
IOptions<NuCacheSettings> config,
IContentCacheDataSerializerFactory contentCacheDataSerializerFactory,
ContentDataSerializer contentDataSerializer)
{
_options = options;
_syncBootStateAccessor = syncBootStateAccessor;
@@ -107,6 +111,8 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
_defaultCultureAccessor = defaultCultureAccessor;
_globalSettings = globalSettings.Value;
_hostingEnvironment = hostingEnvironment;
_contentCacheDataSerializerFactory = contentCacheDataSerializerFactory;
_contentDataSerializer = contentDataSerializer;
_config = config.Value;
_publishedModelFactory = publishedModelFactory;
}
@@ -164,8 +170,8 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
_localMediaDbExists = File.Exists(localMediaDbPath);
// if both local databases exist then GetTree will open them, else new databases will be created
_localContentDb = BTree.GetTree(localContentDbPath, _localContentDbExists, _config);
_localMediaDb = BTree.GetTree(localMediaDbPath, _localMediaDbExists, _config);
_localContentDb = BTree.GetTree(localContentDbPath, _localContentDbExists, _config, _contentDataSerializer);
_localMediaDb = BTree.GetTree(localMediaDbPath, _localMediaDbExists, _config, _contentDataSerializer);
_logger.LogInformation("Registered with MainDom, localContentDbExists? {LocalContentDbExists}, localMediaDbExists? {LocalMediaDbExists}", _localContentDbExists, _localMediaDbExists);
}
@@ -345,10 +351,9 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
// contentStore is wlocked (1 thread)
// content (and types) are read-locked
var contentTypes = _serviceContext.ContentTypeService.GetAll()
.Select(x => _publishedContentTypeFactory.CreateContentType(x));
var contentTypes = _serviceContext.ContentTypeService.GetAll().ToList();
_contentStore.SetAllContentTypesLocked(contentTypes);
_contentStore.SetAllContentTypesLocked(contentTypes.Select(x => _publishedContentTypeFactory.CreateContentType(x)));
using (_profilingLogger.TraceDuration<PublishedSnapshotService>("Loading content from database"))
{
@@ -1117,11 +1122,10 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
/// <inheritdoc />
public void Rebuild(
int groupSize = 5000,
IReadOnlyCollection<int> contentTypeIds = null,
IReadOnlyCollection<int> mediaTypeIds = null,
IReadOnlyCollection<int> memberTypeIds = null)
=> _publishedContentService.Rebuild(groupSize, contentTypeIds, mediaTypeIds, memberTypeIds);
=> _publishedContentService.Rebuild(contentTypeIds, mediaTypeIds, memberTypeIds);
public async Task CollectAsync()
{