Procházet zdrojové kódy

ConfigurationCache is now cleared when validating, to avoid issues where changing database retains old cache

Kenric Nugteren před 3 týdny
rodič
revize
1f854edf32
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      InABox.Core/Client/ClientFactory.cs

+ 7 - 0
InABox.Core/Client/ClientFactory.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using InABox.Configuration;
 using InABox.Core;
 using InABox.Mail;
 
@@ -108,6 +109,9 @@ namespace InABox.Clients
             Version = String.IsNullOrEmpty(version) ? Version : version;
             Parameters = parameters == null ? Parameters : parameters;
             SupportedTypes = parameters == null ? SupportedTypes : null;
+
+            ConfigurationCache.ClearAll(ConfigurationCacheType.User);
+            ConfigurationCache.ClearAll(ConfigurationCacheType.Global);
         }
 
         public static void ClearClientType()
@@ -116,6 +120,9 @@ namespace InABox.Clients
             Platform = default(Platform);
             Version = "";
             Parameters = null;
+
+            ConfigurationCache.ClearAll(ConfigurationCacheType.User);
+            ConfigurationCache.ClearAll(ConfigurationCacheType.Global);
         }
 
         // override the need to provide credentials when configuring the database