From c55fec9fa1a124aa5fce0da770a1602d87e644a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Mets=C3=A4pelto?= Date: Fri, 23 May 2025 16:47:50 +0300 Subject: [PATCH] Validation changed to take place within StartOperations The validation would benefit using cache-enabled M-Files API vault object. It is constructed in the StartOperations call. The validation is way faster if done after the cache is set up, and this improves the service start-up delay. --- ...ultApplicationBase.ConfigurationUpdated.cs | 22 ------------------- .../ConfigurableVaultApplicationBase.cs | 11 ++++++++++ 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/MFiles.VAF.Extensions/ConfigurableVaultApplicationBase.ConfigurationUpdated.cs b/MFiles.VAF.Extensions/ConfigurableVaultApplicationBase.ConfigurationUpdated.cs index e84a6806..23506869 100644 --- a/MFiles.VAF.Extensions/ConfigurableVaultApplicationBase.ConfigurationUpdated.cs +++ b/MFiles.VAF.Extensions/ConfigurableVaultApplicationBase.ConfigurationUpdated.cs @@ -68,27 +68,5 @@ protected override void OnConfigurationUpdated(TSecureConfiguration oldConfigura { get => base.ConfManager; } - - /// - public override void StartOperations(Vault vaultPersistent) - { - // Do we have a valid configuration? - this.isCurrentConfigurationValid = this.IsValid(vaultPersistent); - - // Initialize the application. - base.StartOperations(vaultPersistent); - - // Ensure that our recurring configuration is updated. - try - { - this.RecurringOperationConfigurationManager?.PopulateFromConfiguration(isVaultStartup: true); - } - catch(Exception e) - { - this.Logger?.Fatal(e, $"Exception mapping configuration to recurring operations."); - } - - - } } } diff --git a/MFiles.VAF.Extensions/ConfigurableVaultApplicationBase.cs b/MFiles.VAF.Extensions/ConfigurableVaultApplicationBase.cs index 727dd436..aba86ec2 100644 --- a/MFiles.VAF.Extensions/ConfigurableVaultApplicationBase.cs +++ b/MFiles.VAF.Extensions/ConfigurableVaultApplicationBase.cs @@ -111,12 +111,23 @@ protected TaskQueueBackgroundOperationManager TaskQueueBac protected override void StartApplication() { this.startApplicationCalled = true; + this.isCurrentConfigurationValid = this.IsValid( this.PermanentVault ); this.RecurringOperationConfigurationManager = new RecurringOperationConfigurationManager(this); this.ApplicationOverviewDashboardContentRenderer = this.GetApplicationOverviewDashboardContentRenderer(); this.AsynchronousDashboardContentRenderer = this.GetAsynchronousDashboardContentRenderer(); this.AsynchronousDashboardContentProviders.AddRange(this.GetAsynchronousDashboardContentProviders()); this.LoggingDashboardContentRenderer = this.GetLoggingDashboardContentRenderer(); + // Ensure that our recurring configuration is updated. + try + { + this.RecurringOperationConfigurationManager?.PopulateFromConfiguration(isVaultStartup: true); + } + catch(Exception e) + { + this.Logger?.Fatal(e, $"Exception mapping configuration to recurring operations."); + } + #if DEBUG // In debug builds we want to show the referenced assemblies and the like. {