diff --git a/Server/Program.cs b/Server/Program.cs index e203b3b..0c67d9b 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -42,7 +42,8 @@ builder.Services.AddDbContextPool(o => builder.Services.AddSingleton(loggerFactory); builder.Services.AddSingleton(); builder.Services.AddSingleton(); -builder.Services.AddHostedService(); +builder.Services.AddHostedService(provider => + provider.GetService() ?? throw new InvalidOperationException()); builder.Services.AddHostedService(provider => provider.GetService() ?? throw new InvalidOperationException()); builder.Services.AddMassTransit(x =>