refactor: Use AddProfileWorker extension method in Program.cs

- Replace direct AddHostedService<ProfileManager> with AddProfileWorker()
- Enables IOptions configuration and validation at startup
- Add using directive for ECMJobRunner.WebCron.ProfileWorker namespace
This commit is contained in:
2026-07-13 11:59:52 +02:00
parent 2fd99694b6
commit 41b08e3454

View File

@@ -1,6 +1,7 @@
using ECMJobRunner.Application; using ECMJobRunner.Application;
using ECMJobRunner.Infrastructure; using ECMJobRunner.Infrastructure;
using ECMJobRunner.WebCron; using ECMJobRunner.WebCron;
using ECMJobRunner.WebCron.ProfileWorker;
using Hangfire; using Hangfire;
using Hangfire.SqlServer; using Hangfire.SqlServer;
using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient;
@@ -53,7 +54,7 @@ try
// Add services to the container. // Add services to the container.
builder.Services.AddControllers(); builder.Services.AddControllers();
builder.Services.AddHostedService<ProfileManager>(); builder.Services.AddProfileWorker(builder.Configuration);
// Register services // Register services
var cnnStr = builder.Configuration.GetConnectionString("SDD-VMP04-SQL17") var cnnStr = builder.Configuration.GetConnectionString("SDD-VMP04-SQL17")