https://github.com/umbraco/Umbraco-CMS/issues/15195 Fixed issue with media not cached correct (#15196)
This commit is contained in:
@@ -224,7 +224,7 @@ AND cmsContentNu.nodeId IS NULL
|
|||||||
IContentCacheDataSerializer serializer =
|
IContentCacheDataSerializer serializer =
|
||||||
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document);
|
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document);
|
||||||
|
|
||||||
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql);
|
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql, Constants.ObjectTypes.Document);
|
||||||
|
|
||||||
foreach (ContentSourceDto row in dtos)
|
foreach (ContentSourceDto row in dtos)
|
||||||
{
|
{
|
||||||
@@ -242,7 +242,7 @@ AND cmsContentNu.nodeId IS NULL
|
|||||||
IContentCacheDataSerializer serializer =
|
IContentCacheDataSerializer serializer =
|
||||||
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document);
|
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document);
|
||||||
|
|
||||||
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql);
|
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql, Constants.ObjectTypes.Document);
|
||||||
|
|
||||||
foreach (ContentSourceDto row in dtos)
|
foreach (ContentSourceDto row in dtos)
|
||||||
{
|
{
|
||||||
@@ -265,7 +265,7 @@ AND cmsContentNu.nodeId IS NULL
|
|||||||
IContentCacheDataSerializer serializer =
|
IContentCacheDataSerializer serializer =
|
||||||
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document);
|
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Document);
|
||||||
|
|
||||||
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql);
|
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql, Constants.ObjectTypes.Document);
|
||||||
|
|
||||||
foreach (ContentSourceDto row in dtos)
|
foreach (ContentSourceDto row in dtos)
|
||||||
{
|
{
|
||||||
@@ -301,7 +301,7 @@ AND cmsContentNu.nodeId IS NULL
|
|||||||
IContentCacheDataSerializer serializer =
|
IContentCacheDataSerializer serializer =
|
||||||
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media);
|
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media);
|
||||||
|
|
||||||
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql);
|
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql, Constants.ObjectTypes.Media);
|
||||||
|
|
||||||
foreach (ContentSourceDto row in dtos)
|
foreach (ContentSourceDto row in dtos)
|
||||||
{
|
{
|
||||||
@@ -319,7 +319,7 @@ AND cmsContentNu.nodeId IS NULL
|
|||||||
IContentCacheDataSerializer serializer =
|
IContentCacheDataSerializer serializer =
|
||||||
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media);
|
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media);
|
||||||
|
|
||||||
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql);
|
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql, Constants.ObjectTypes.Media);
|
||||||
|
|
||||||
foreach (ContentSourceDto row in dtos)
|
foreach (ContentSourceDto row in dtos)
|
||||||
{
|
{
|
||||||
@@ -342,7 +342,7 @@ AND cmsContentNu.nodeId IS NULL
|
|||||||
IContentCacheDataSerializer serializer =
|
IContentCacheDataSerializer serializer =
|
||||||
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media);
|
_contentCacheDataSerializerFactory.Create(ContentCacheDataSerializerEntityType.Media);
|
||||||
|
|
||||||
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql);
|
IEnumerable<ContentSourceDto> dtos = GetContentNodeDtos(sql, Constants.ObjectTypes.Media);
|
||||||
|
|
||||||
foreach (ContentSourceDto row in dtos)
|
foreach (ContentSourceDto row in dtos)
|
||||||
{
|
{
|
||||||
@@ -990,7 +990,7 @@ WHERE cmsContentNu.nodeId IN (
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<ContentSourceDto> GetContentNodeDtos(Sql<ISqlContext> sql)
|
private IEnumerable<ContentSourceDto> GetContentNodeDtos(Sql<ISqlContext> sql, Guid nodeObjectType)
|
||||||
{
|
{
|
||||||
// We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout.
|
// We need to page here. We don't want to iterate over every single row in one connection cuz this can cause an SQL Timeout.
|
||||||
// We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that.
|
// We also want to read with a db reader and not load everything into memory, QueryPaged lets us do that.
|
||||||
@@ -1000,7 +1000,7 @@ WHERE cmsContentNu.nodeId IN (
|
|||||||
{
|
{
|
||||||
// Use a more efficient COUNT query
|
// Use a more efficient COUNT query
|
||||||
Sql<ISqlContext>? sqlCountQuery = SqlContentSourcesCount()
|
Sql<ISqlContext>? sqlCountQuery = SqlContentSourcesCount()
|
||||||
.Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Document));
|
.Append(SqlObjectTypeNotTrashed(SqlContext, nodeObjectType));
|
||||||
|
|
||||||
Sql<ISqlContext>? sqlCount =
|
Sql<ISqlContext>? sqlCount =
|
||||||
SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl");
|
SqlContext.Sql("SELECT COUNT(*) FROM (").Append(sqlCountQuery).Append(") npoco_tbl");
|
||||||
|
|||||||
Reference in New Issue
Block a user