fix(worker): enable safe multi-instance job processing
Some checks failed
ci / release-gate (push) Has been cancelled
Some checks failed
ci / release-gate (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Tiku.Application.Jobs;
|
||||
using Tiku.Infrastructure.Jobs;
|
||||
|
||||
@@ -8,6 +9,9 @@ internal static class JobsModule
|
||||
{
|
||||
internal static IServiceCollection AddJobsModule(this IServiceCollection services)
|
||||
{
|
||||
services.TryAddSingleton(TimeProvider.System);
|
||||
services.AddSingleton(BackgroundJobLeaseTiming.Default);
|
||||
services.AddSingleton<BackgroundJobLeaseManager>();
|
||||
services.AddScoped<BackgroundJobService>();
|
||||
services.AddScoped<IBackgroundJobService>(provider => provider.GetRequiredService<BackgroundJobService>());
|
||||
services.AddScoped<IBackgroundJobQueue>(provider => provider.GetRequiredService<BackgroundJobService>());
|
||||
|
||||
Reference in New Issue
Block a user