Browse Source

Merge pull request #12852 from gdlcf88/make-boxes-orderly

Using the event boxes orderly
pull/12946/head
liangshiwei 4 years ago
committed by GitHub
parent
commit
883ab74488
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs

5
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
@ -102,7 +103,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
return false; return false;
} }
foreach (var outboxConfig in AbpDistributedEventBusOptions.Outboxes.Values) foreach (var outboxConfig in AbpDistributedEventBusOptions.Outboxes.Values.OrderBy(x => x.Selector is null))
{ {
if (outboxConfig.Selector == null || outboxConfig.Selector(eventType)) if (outboxConfig.Selector == null || outboxConfig.Selector(eventType))
{ {
@ -137,7 +138,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB
using (var scope = ServiceScopeFactory.CreateScope()) using (var scope = ServiceScopeFactory.CreateScope())
{ {
foreach (var inboxConfig in AbpDistributedEventBusOptions.Inboxes.Values) foreach (var inboxConfig in AbpDistributedEventBusOptions.Inboxes.Values.OrderBy(x => x.EventSelector is null))
{ {
if (inboxConfig.EventSelector == null || inboxConfig.EventSelector(eventType)) if (inboxConfig.EventSelector == null || inboxConfig.EventSelector(eventType))
{ {

Loading…
Cancel
Save