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<IEnvelopeAuthService, EnvelopeAuthService>();
|
||||||
builder.Services.AddScoped<EnvelopeReceiverAuthorizationService>();
|
builder.Services.AddScoped<EnvelopeReceiverAuthorizationService>();
|
||||||
builder.Services.AddScoped<EnvelopeReceiverPageDataService>();
|
builder.Services.AddScoped<EnvelopeReceiverPageDataService>();
|
||||||
|
|
||||||
|
var enableEnvelopeFinalizationWorker = config.GetValue("BackgroundServices:EnableEnvelopeFinalizationWorker", false);
|
||||||
|
if (enableEnvelopeFinalizationWorker)
|
||||||
|
{
|
||||||
builder.Services.AddHostedService<EnvelopeFinalizationWorker>();
|
builder.Services.AddHostedService<EnvelopeFinalizationWorker>();
|
||||||
|
}
|
||||||
|
|
||||||
// DevExpress Server-Side Services (CRITICAL for DxPdfViewer)
|
// DevExpress Server-Side Services (CRITICAL for DxPdfViewer)
|
||||||
builder.Services.AddDevExpressBlazor();
|
builder.Services.AddDevExpressBlazor();
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"BackgroundServices": {
|
||||||
|
"EnableEnvelopeFinalizationWorker": true
|
||||||
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
"UseSwagger": true,
|
"UseSwagger": true,
|
||||||
"UseScalar": true,
|
"UseScalar": true,
|
||||||
"UseDbMigration": false,
|
"UseDbMigration": false,
|
||||||
|
"BackgroundServices": {
|
||||||
|
"EnableEnvelopeFinalizationWorker": false
|
||||||
|
},
|
||||||
"DevEndpoints": {
|
"DevEndpoints": {
|
||||||
"EnableSignatureInkInProduction": false
|
"EnableSignatureInkInProduction": false
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user