From 84d98f48c79489c82f611235e00bc37f602a3267 Mon Sep 17 00:00:00 2001 From: Mole Date: Tue, 30 Mar 2021 11:14:50 +0200 Subject: [PATCH] Register notifications for DistributedCacheBinder --- .../Cache/DistributedCacheBinder_Handlers.cs | 8 ++++++-- .../Compose/NotificationsComposer.cs | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Infrastructure/Cache/DistributedCacheBinder_Handlers.cs b/src/Umbraco.Infrastructure/Cache/DistributedCacheBinder_Handlers.cs index a6b0dd73db..41195be9fe 100644 --- a/src/Umbraco.Infrastructure/Cache/DistributedCacheBinder_Handlers.cs +++ b/src/Umbraco.Infrastructure/Cache/DistributedCacheBinder_Handlers.cs @@ -189,14 +189,18 @@ namespace Umbraco.Cms.Core.Cache public void Handle(DataTypeSavedNotification notification) { - foreach (var entity in notification.SavedEntities) + foreach (IDataType entity in notification.SavedEntities) + { _distributedCache.RefreshDataTypeCache(entity); + } } public void Handle(DataTypeDeletedNotification notification) { - foreach (var entity in notification.DeletedEntities) + foreach (IDataType entity in notification.DeletedEntities) + { _distributedCache.RemoveDataTypeCache(entity); + } } #endregion diff --git a/src/Umbraco.Infrastructure/Compose/NotificationsComposer.cs b/src/Umbraco.Infrastructure/Compose/NotificationsComposer.cs index be6539ac55..e9e7bf30af 100644 --- a/src/Umbraco.Infrastructure/Compose/NotificationsComposer.cs +++ b/src/Umbraco.Infrastructure/Compose/NotificationsComposer.cs @@ -78,7 +78,11 @@ namespace Umbraco.Cms.Core.Compose .AddNotificationHandler() .AddNotificationHandler() .AddNotificationHandler() - .AddNotificationHandler(); + .AddNotificationHandler() + .AddNotificationHandler() + .AddNotificationHandler() + .AddNotificationHandler() + .AddNotificationHandler(); // add notification handlers for auditing builder