adding an event

This commit is contained in:
Shannon
2020-04-20 22:45:12 +10:00
parent d9cb9f27f1
commit 44df0dda2b
2 changed files with 18 additions and 2 deletions

View File

@@ -858,6 +858,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
Notify<IContentType>(_contentStore, payloads, RefreshContentTypesLocked);
Notify<IMediaType>(_mediaStore, payloads, RefreshMediaTypesLocked);
OnNotified(new NotifiedEventArgs<ContentTypeCacheRefresher.JsonPayload>(payloads));
if (_publishedModelFactory.IsLiveFactory())
{
//In the case of Pure Live - we actually need to refresh all of the content and the media

View File

@@ -1,11 +1,22 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web.Cache;
namespace Umbraco.Web.PublishedCache
{
abstract class PublishedSnapshotServiceBase : IPublishedSnapshotService
internal class NotifiedEventArgs<T> : EventArgs
{
public NotifiedEventArgs(T[] payloads)
{
Payloads = payloads;
}
public T[] Payloads { get; }
}
internal abstract class PublishedSnapshotServiceBase : IPublishedSnapshotService
{
protected PublishedSnapshotServiceBase(IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor)
{
@@ -38,5 +49,8 @@ namespace Umbraco.Web.PublishedCache
public virtual void Dispose()
{ }
protected void OnNotified(NotifiedEventArgs<ContentTypeCacheRefresher.JsonPayload> args) => Notified?.Invoke(this, args);
public event EventHandler<NotifiedEventArgs<ContentTypeCacheRefresher.JsonPayload>> Notified;
}
}