WIP (fixes migrations)

This commit is contained in:
Shannon
2020-09-24 18:37:24 +10:00
parent 8c4650951d
commit 6bd6d97bda
16 changed files with 159 additions and 112 deletions

View File

@@ -129,7 +129,9 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
// We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that.
foreach (var row in scope.Database.QueryPaged<ContentSourceDto>(PageSize, sql, sqlCount))
{
yield return CreateContentNodeKit(row);
}
}
public IEnumerable<ContentNodeKit> GetBranchContentSources(IScope scope, int id)
@@ -145,7 +147,9 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
// We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that.
foreach (var row in scope.Database.QueryPaged<ContentSourceDto>(PageSize, sql))
{
yield return CreateContentNodeKit(row);
}
}
public IEnumerable<ContentNodeKit> GetTypeContentSources(IScope scope, IEnumerable<int> ids)
@@ -161,7 +165,9 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
// We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that.
foreach (var row in scope.Database.QueryPaged<ContentSourceDto>(PageSize, sql))
{
yield return CreateContentNodeKit(row);
}
}
private Sql<ISqlContext> MediaSourcesSelect(IScope scope, Func<Sql<ISqlContext>, Sql<ISqlContext>> joins = null)

View File

@@ -7,6 +7,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Umbraco.Core.PropertyEditors;
using Umbraco.Web.PropertyEditors;
namespace Umbraco.Web.PublishedCache.NuCache.DataSource

View File

@@ -3,6 +3,7 @@ using System.Configuration;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.PropertyEditors;
using Umbraco.Web.PropertyEditors;
using Umbraco.Web.PublishedCache.NuCache.DataSource;
@@ -24,7 +25,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
else
{
composition.RegisterUnique<IContentNestedDataSerializer, MsgPackContentNestedDataSerializer>();
composition.RegisterUnique<IPropertyCompressionOptions, ComplexEditorPropertyCompressionOptions>();
composition.RegisterUnique<IPropertyCompressionOptions, CompressedStoragePropertyEditorCompressionOptions>();
}
composition.RegisterUnique(factory => new ContentDataSerializer(new DictionaryOfPropertyDataSerializer()));

View File

@@ -387,10 +387,9 @@ namespace Umbraco.Web.PublishedCache.NuCache
// 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 (_logger.TraceDuration<PublishedSnapshotService>("Loading content from database"))
{