diff --git a/src/Umbraco.Core/Events/EventAggregator.Notifications.cs b/src/Umbraco.Core/Events/EventAggregator.Notifications.cs index d298f5bbec..94d4804cd4 100644 --- a/src/Umbraco.Core/Events/EventAggregator.Notifications.cs +++ b/src/Umbraco.Core/Events/EventAggregator.Notifications.cs @@ -137,7 +137,7 @@ internal class NotificationAsyncHandlerWrapperImpl : Notification /// confusion. /// /// - public override Task HandleAsync( + public override async Task HandleAsync( INotification notification, CancellationToken cancellationToken, ServiceFactory serviceFactory, @@ -155,7 +155,7 @@ internal class NotificationAsyncHandlerWrapperImpl : Notification (theNotification, theToken) => x.HandleAsync((TNotification)theNotification, theToken))); - return publish(handlers, notification, cancellationToken); + await publish(handlers, notification, cancellationToken); } } diff --git a/src/Umbraco.Core/Events/EventAggregator.cs b/src/Umbraco.Core/Events/EventAggregator.cs index 277b24eb06..b5de38c66d 100644 --- a/src/Umbraco.Core/Events/EventAggregator.cs +++ b/src/Umbraco.Core/Events/EventAggregator.cs @@ -50,7 +50,7 @@ public partial class EventAggregator : IEventAggregator => _serviceFactory = serviceFactory; /// - public Task PublishAsync(TNotification notification, CancellationToken cancellationToken = default) + public async Task PublishAsync(TNotification notification, CancellationToken cancellationToken = default) where TNotification : INotification { // TODO: Introduce codegen efficient Guard classes to reduce noise. @@ -60,7 +60,7 @@ public partial class EventAggregator : IEventAggregator } PublishNotification(notification); - return PublishNotificationAsync(notification, cancellationToken); + await PublishNotificationAsync(notification, cancellationToken); } ///