From c9bd1b5be92ab164de17c87065dac84a1d3cda14 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 30 Jul 2022 23:38:01 +0200 Subject: [PATCH] Fixed cache handling for DeepL action & API key --- I18N Commander/Processor/AppSettings.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/I18N Commander/Processor/AppSettings.cs b/I18N Commander/Processor/AppSettings.cs index b99d94d..5d07220 100644 --- a/I18N Commander/Processor/AppSettings.cs +++ b/I18N Commander/Processor/AppSettings.cs @@ -115,6 +115,10 @@ public static class AppSettings public static async Task GetDeepLAPIKey() { + // Check the cache: + if (CACHE_DEEPL_API_KEY_IS_LOADED) + return CACHE_DEEPL_API_KEY; + // Get the database: await using var db = ProcessorMeta.ServiceProvider.GetRequiredService(); @@ -181,6 +185,10 @@ public static class AppSettings public static async Task GetDeepLAction() { + // Check the cache: + if (CACHE_DEEPL_ACTION_IS_LOADED) + return CACHE_DEEPL_ACTION; + // Get the database: await using var db = ProcessorMeta.ServiceProvider.GetRequiredService();