Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikus1993 committed Jun 8, 2024
1 parent 5913eba commit e2af07d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
}

var subscriber = serviceScope.ServiceProvider.GetRequiredService(type.Handler);
var handle = _methodInfos.GetOrAdd(type.Message,
(messageType) =>
typeof(IMessageSubscriber<>).MakeGenericType(messageType).GetMethod(nameof(IMessageSubscriber<IMessage>.Handle))!);
var handle = _methodInfos.GetOrAdd(subscriber.GetType(),
(subscriberType) =>
subscriberType.GetMethod(nameof(IMessageSubscriber<IMessage>.Handle))!);

var result = await (Task<Result<Unit>>)handle.Invoke(subscriber, [msg, ct])!;
if (!result.IsSuccess)
Expand Down

0 comments on commit e2af07d

Please sign in to comment.