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:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user