Files
tiku-backend.net/Tiku.Infrastructure/Modules/JobsModule.cs
xiong 7adcb6a3d5
Some checks failed
ci / release-gate (push) Has been cancelled
refactor(jobs): modularize background job handlers
2026-08-03 13:28:21 +08:00

20 lines
882 B
C#

using Microsoft.Extensions.DependencyInjection;
using Tiku.Application.Jobs;
using Tiku.Infrastructure.Jobs;
namespace Tiku.Infrastructure;
internal static class JobsModule
{
internal static IServiceCollection AddJobsModule(this IServiceCollection services)
{
services.AddScoped<BackgroundJobService>();
services.AddScoped<IBackgroundJobService>(provider => provider.GetRequiredService<BackgroundJobService>());
services.AddScoped<IBackgroundJobQueue>(provider => provider.GetRequiredService<BackgroundJobService>());
services.AddScoped<IBackgroundJobProcessor>(provider => provider.GetRequiredService<BackgroundJobService>());
services.AddScoped<IBackgroundJobOperations>(provider => provider.GetRequiredService<BackgroundJobService>());
services.AddScoped<BackgroundJobHandlerRegistry>();
return services;
}
}