Skip to content

Commit

Permalink
bugfix: don't register the subscriber twice
Browse files Browse the repository at this point in the history
  • Loading branch information
the-avid-engineer committed Sep 7, 2022
1 parent 25d0de8 commit 7eaa56d
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,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 @@ -74,10 +72,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 7eaa56d

Please sign in to comment.