Импорт
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
using Knot.Modules.TelegramImport.Application.Abstractions;
|
||||
using Knot.Modules.TelegramImport.Infrastructure.Background;
|
||||
using Knot.Modules.TelegramImport.Infrastructure.Parser;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Knot.Modules.TelegramImport;
|
||||
@@ -6,6 +9,13 @@ public static class DependencyInjection
|
||||
{
|
||||
public static IServiceCollection AddTelegramImportModule(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<ITelegramHtmlParser, TelegramHtmlParser>();
|
||||
services.AddSingleton<IImportJobStore, ImportJobStore>();
|
||||
|
||||
// Register worker as itself and as a hosted service
|
||||
services.AddSingleton<TelegramImportWorker>();
|
||||
services.AddHostedService<TelegramImportWorker>(sp => sp.GetRequiredService<TelegramImportWorker>());
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user