Add conditional EnvelopeFinalizationWorker service
Introduce a configuration-based mechanism to enable or disable the `EnvelopeFinalizationWorker` hosted service. - Updated `Program.cs` to conditionally register the service based on the `BackgroundServices:EnableEnvelopeFinalizationWorker` configuration setting. - Added `BackgroundServices` section to `appsettings.json` with the worker disabled by default. - Added `BackgroundServices` section to `appsettings.Development.json` with the worker enabled in the development environment.
This commit is contained in:
@@ -423,7 +423,12 @@ try
|
||||
builder.Services.AddScoped<IEnvelopeAuthService, EnvelopeAuthService>();
|
||||
builder.Services.AddScoped<EnvelopeReceiverAuthorizationService>();
|
||||
builder.Services.AddScoped<EnvelopeReceiverPageDataService>();
|
||||
builder.Services.AddHostedService<EnvelopeFinalizationWorker>();
|
||||
|
||||
var enableEnvelopeFinalizationWorker = config.GetValue("BackgroundServices:EnableEnvelopeFinalizationWorker", false);
|
||||
if (enableEnvelopeFinalizationWorker)
|
||||
{
|
||||
builder.Services.AddHostedService<EnvelopeFinalizationWorker>();
|
||||
}
|
||||
|
||||
// DevExpress Server-Side Services (CRITICAL for DxPdfViewer)
|
||||
builder.Services.AddDevExpressBlazor();
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"BackgroundServices": {
|
||||
"EnableEnvelopeFinalizationWorker": true
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
"UseSwagger": true,
|
||||
"UseScalar": true,
|
||||
"UseDbMigration": false,
|
||||
"BackgroundServices": {
|
||||
"EnableEnvelopeFinalizationWorker": false
|
||||
},
|
||||
"DevEndpoints": {
|
||||
"EnableSignatureInkInProduction": false
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user