Browse Source

Merge pull request #21786 from abpframework/GetHandlerFactories

Avoid HandlerFactories being changed during iteration.
pull/21788/head
Engincan VESKE 1 year ago
committed by GitHub
parent
commit
89171cab64
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs

4
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs

@ -135,9 +135,9 @@ public abstract class EventBusBase : IEventBus
{
await new SynchronizationContextRemover();
foreach (var handlerFactories in GetHandlerFactories(eventType))
foreach (var handlerFactories in GetHandlerFactories(eventType).ToList())
{
foreach (var handlerFactory in handlerFactories.EventHandlerFactories)
foreach (var handlerFactory in handlerFactories.EventHandlerFactories.ToList())
{
await TriggerHandlerAsync(handlerFactory, handlerFactories.EventType, eventData, exceptions, inboxConfig);
}

Loading…
Cancel
Save