Browse Source

Merge pull request #9670 from abpframework/auto-merge/rel-4-4/497

Merge branch dev with rel-4.4
pull/9676/head
liangshiwei 5 years ago
committed by GitHub
parent
commit
14c07e6d41
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs
  2. 3
      framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Exception_Handler_Tests.cs
  3. 2
      npm/ng-packs/packages/theme-shared/src/lib/constants/styles.ts

9
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs

@ -30,17 +30,13 @@ namespace Volo.Abp.EventBus.Local
protected ConcurrentDictionary<Type, List<IEventHandlerFactory>> HandlerFactories { get; } protected ConcurrentDictionary<Type, List<IEventHandlerFactory>> HandlerFactories { get; }
protected IJsonSerializer Serializer { get; }
public LocalEventBus( public LocalEventBus(
IOptions<AbpLocalEventBusOptions> options, IOptions<AbpLocalEventBusOptions> options,
IServiceScopeFactory serviceScopeFactory, IServiceScopeFactory serviceScopeFactory,
ICurrentTenant currentTenant, ICurrentTenant currentTenant,
IEventErrorHandler errorHandler, IEventErrorHandler errorHandler)
IJsonSerializer serializer)
: base(serviceScopeFactory, currentTenant, errorHandler) : base(serviceScopeFactory, currentTenant, errorHandler)
{ {
Serializer = serializer;
Options = options.Value; Options = options.Value;
Logger = NullLogger<LocalEventBus>.Instance; Logger = NullLogger<LocalEventBus>.Instance;
@ -131,10 +127,9 @@ namespace Volo.Abp.EventBus.Local
public virtual async Task PublishAsync(LocalEventMessage localEventMessage) public virtual async Task PublishAsync(LocalEventMessage localEventMessage)
{ {
var rawEventData = Serializer.Serialize(localEventMessage.EventData);
await TriggerHandlersAsync(localEventMessage.EventType, localEventMessage.EventData, errorContext => await TriggerHandlersAsync(localEventMessage.EventType, localEventMessage.EventData, errorContext =>
{ {
errorContext.EventData = Serializer.Deserialize(localEventMessage.EventType, rawEventData); errorContext.EventData = localEventMessage.EventData;
errorContext.SetProperty(nameof(LocalEventMessage.MessageId), localEventMessage.MessageId); errorContext.SetProperty(nameof(LocalEventMessage.MessageId), localEventMessage.MessageId);
}); });
} }

3
framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Exception_Handler_Tests.cs

@ -33,9 +33,7 @@ namespace Volo.Abp.EventBus.Local
LocalEventBus.Subscribe<MyExceptionHandleEventData>(eventData => LocalEventBus.Subscribe<MyExceptionHandleEventData>(eventData =>
{ {
eventData.Value.ShouldBe(0); eventData.Value.ShouldBe(0);
retryAttempt++; retryAttempt++;
eventData.Value++;
if (retryAttempt < 2) if (retryAttempt < 2)
{ {
throw new Exception("This exception is intentionally thrown!"); throw new Exception("This exception is intentionally thrown!");
@ -58,7 +56,6 @@ namespace Volo.Abp.EventBus.Local
eventData.Value.ShouldBe(0); eventData.Value.ShouldBe(0);
retryAttempt++; retryAttempt++;
eventData.Value++;
throw new Exception("This exception is intentionally thrown!"); throw new Exception("This exception is intentionally thrown!");
}); });

2
npm/ng-packs/packages/theme-shared/src/lib/constants/styles.ts

@ -149,7 +149,7 @@ export default `
.ngx-datatable.material { .ngx-datatable.material {
box-shadow: none; box-shadow: none;
} }
ngb-typeahead-window { ngb-typeahead-window, ngb-typeahead-window.dropdown-menu {
max-height: 25em; max-height: 25em;
overflow-y: scroll !important; overflow-y: scroll !important;
z-index: 1050; z-index: 1050;

Loading…
Cancel
Save