From 41b08e34541ada7f0e87948cff97e7b435068f8e Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 13 Jul 2026 11:59:52 +0200 Subject: [PATCH] refactor: Use AddProfileWorker extension method in Program.cs - Replace direct AddHostedService with AddProfileWorker() - Enables IOptions configuration and validation at startup - Add using directive for ECMJobRunner.WebCron.ProfileWorker namespace --- ECMJobRunner.WebCron/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ECMJobRunner.WebCron/Program.cs b/ECMJobRunner.WebCron/Program.cs index 3fc037d..26ae8c0 100644 --- a/ECMJobRunner.WebCron/Program.cs +++ b/ECMJobRunner.WebCron/Program.cs @@ -1,6 +1,7 @@ using ECMJobRunner.Application; using ECMJobRunner.Infrastructure; using ECMJobRunner.WebCron; +using ECMJobRunner.WebCron.ProfileWorker; using Hangfire; using Hangfire.SqlServer; using Microsoft.Data.SqlClient; @@ -53,7 +54,7 @@ try // Add services to the container. builder.Services.AddControllers(); -builder.Services.AddHostedService(); +builder.Services.AddProfileWorker(builder.Configuration); // Register services var cnnStr = builder.Configuration.GetConnectionString("SDD-VMP04-SQL17")