Skip to content

Commit

Permalink
bugfix: don't register the subscriber twice (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-avid-engineer authored Sep 7, 2022
1 parent 066b2d2 commit 952ef0e
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ private static void AddBufferBlockTransactionProcessorQueue<TTransactionProcesso

serviceCollection.AddHostedService(serviceProvider =>
serviceProvider.GetRequiredService<BufferBlockTransactionQueue<TTransactionProcessor>>());

serviceCollection.AddSingleton<ITransactionSubscriber, TransactionProcessorSubscriber<TTransactionProcessor>>();
}

internal static void Add<TService>(this IServiceCollection serviceCollection, ServiceLifetime serviceLifetime,
Expand Down Expand Up @@ -80,10 +78,7 @@ public static void AddTransactionProcessorSubscriber<TTransactionProcessor>(this

serviceCollection.AddSingleton<TransactionProcessorSubscriber<TTransactionProcessor>>();

serviceCollection.AddSingleton<ITransactionSubscriber>(
serviceProvider =>
serviceProvider.GetRequiredService<TransactionProcessorSubscriber<TTransactionProcessor>>()
);
serviceCollection.AddSingleton<ITransactionSubscriber, TransactionProcessorSubscriber<TTransactionProcessor>>();

if (testMode)
{
Expand Down

0 comments on commit 952ef0e

Please sign in to comment.