Change FinalizeDocumentJob to scoped, add ReportCreator
Changed FinalizeDocumentJob DI registration from singleton to scoped for better instance management. Added ReportCreator as a scoped service. Removed unused EnvelopeGenerator.ServiceHost.Jobs.Infrastructure import.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using EnvelopeGenerator.ServiceHost.Jobs;
|
||||
using EnvelopeGenerator.ServiceHost.Jobs.FinalizeDocument;
|
||||
using EnvelopeGenerator.ServiceHost.Jobs.Infrastructure;
|
||||
using GdPicture14;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
@@ -12,11 +11,12 @@ public static class DependencyInjection
|
||||
public static IServiceCollection AddFinalizeDocumentJob(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.Configure<WorkerOptions>(configuration.GetSection(nameof(WorkerOptions)));
|
||||
services.AddSingleton<FinalizeDocumentJob>();
|
||||
services.AddScoped<FinalizeDocumentJob>();
|
||||
services.AddScoped<ActionService>();
|
||||
services.AddSingleton<TempFiles>();
|
||||
services.AddScoped<PDFBurner>();
|
||||
services.AddScoped<PDFMerger>();
|
||||
services.AddScoped<ReportCreator>();
|
||||
|
||||
//TODO: Check lifetime of services. They might be singleton or scoped.
|
||||
services.AddTransient<GdViewer>();
|
||||
|
||||
Reference in New Issue
Block a user