Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco.Web.Backoffice

# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
#	src/Umbraco.Core/Extensions/PublishedContentExtensions.cs
#	src/Umbraco.Core/Telemetry/Models/TelemetryReportData.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MultiUrlPickerValueConverter.cs
#	src/Umbraco.PublishedCache.NuCache/ContentStore.cs
#	src/Umbraco.Web.BackOffice/Trees/MemberTypeTreeController.cs
#	src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs
#	src/Umbraco.Web.Common/Security/MemberManager.cs
#	src/Umbraco.Web.Website/Routing/ControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/IControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformer.cs
This commit is contained in:
Nikolaj Geisle
2022-04-21 10:26:51 +02:00
172 changed files with 4578 additions and 1710 deletions

View File

@@ -337,8 +337,19 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
_localContentDb?.Clear();
// IMPORTANT GetAllContentSources sorts kits by level + parentId + sortOrder
var kits = _publishedContentService.GetAllContentSources();
return onStartup ? _contentStore.SetAllFastSortedLocked(kits, true) : _contentStore.SetAllLocked(kits);
try
{
var kits = _publishedContentService.GetAllContentSources();
return onStartup ? _contentStore.SetAllFastSortedLocked(kits, _config.KitBatchSize, true) : _contentStore.SetAllLocked(kits, _config.KitBatchSize, true);
}
catch (ThreadAbortException tae)
{
// Caught a ThreadAbortException, most likely from a database timeout.
// If we don't catch it here, the whole local cache can remain locked causing widespread panic (see above comment).
_logger.LogWarning(tae, tae.Message);
}
return false;
}
}
@@ -385,8 +396,20 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
_logger.LogDebug("Loading media from database...");
// IMPORTANT GetAllMediaSources sorts kits by level + parentId + sortOrder
var kits = _publishedContentService.GetAllMediaSources();
return onStartup ? _mediaStore.SetAllFastSortedLocked(kits, true) : _mediaStore.SetAllLocked(kits);
try
{
var kits = _publishedContentService.GetAllMediaSources();
return onStartup ? _mediaStore.SetAllFastSortedLocked(kits, _config.KitBatchSize, true) : _mediaStore.SetAllLocked(kits, _config.KitBatchSize, true);
}
catch (ThreadAbortException tae)
{
// Caught a ThreadAbortException, most likely from a database timeout.
// If we don't catch it here, the whole local cache can remain locked causing widespread panic (see above comment).
_logger.LogWarning(tae, tae.Message);
}
return false;
}
}
@@ -434,7 +457,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
return false;
}
return onStartup ? store.SetAllFastSortedLocked(kits, false) : store.SetAllLocked(kits);
return onStartup ? store.SetAllFastSortedLocked(kits, _config.KitBatchSize, false) : store.SetAllLocked(kits, _config.KitBatchSize, false);
}
private void LockAndLoadDomains()