Skip cache refresher operations for content blueprints (#15633)

* Skip cache refresher operations for content blueprints

* Fix JsonPayload deserialization error by adding a default constructor and property initializers

* Obsolete JsonPayload constructor and update usages
This commit is contained in:
Ronald Barendse
2024-02-01 09:55:09 +01:00
committed by Bjarke Berg
parent ac02e97e0c
commit 4aed6a1034
7 changed files with 239 additions and 50 deletions

View File

@@ -215,7 +215,16 @@ internal class PublishedSnapshotService : IPublishedSnapshotService
// they require.
using (_contentStore.GetScopedWriteLock(_scopeProvider))
{
NotifyLocked(new[] { new ContentCacheRefresher.JsonPayload(0, null, TreeChangeTypes.RefreshAll) }, out _, out _);
NotifyLocked(
new[]
{
new ContentCacheRefresher.JsonPayload()
{
ChangeTypes = TreeChangeTypes.RefreshAll
}
},
out _,
out _);
}
using (_mediaStore.GetScopedWriteLock(_scopeProvider))
@@ -891,6 +900,12 @@ internal class PublishedSnapshotService : IPublishedSnapshotService
_logger.LogDebug("Notified {ChangeTypes} for content {ContentId}", payload.ChangeTypes, payload.Id);
}
if (payload.Blueprint)
{
// Skip blueprints
continue;
}
if (payload.ChangeTypes.HasType(TreeChangeTypes.RefreshAll))
{
using (IScope scope = _scopeProvider.CreateScope())