Fixed cache handling for DeepL action & API key

This commit is contained in:
Thorsten Sommer 2022-07-30 23:38:01 +02:00
parent 38416cb675
commit c9bd1b5be9
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -115,6 +115,10 @@ public static class AppSettings
public static async Task<string> GetDeepLAPIKey() public static async Task<string> GetDeepLAPIKey()
{ {
// Check the cache:
if (CACHE_DEEPL_API_KEY_IS_LOADED)
return CACHE_DEEPL_API_KEY;
// Get the database: // Get the database:
await using var db = ProcessorMeta.ServiceProvider.GetRequiredService<DataContext>(); await using var db = ProcessorMeta.ServiceProvider.GetRequiredService<DataContext>();
@ -181,6 +185,10 @@ public static class AppSettings
public static async Task<SettingDeepLAction> GetDeepLAction() public static async Task<SettingDeepLAction> GetDeepLAction()
{ {
// Check the cache:
if (CACHE_DEEPL_ACTION_IS_LOADED)
return CACHE_DEEPL_ACTION;
// Get the database: // Get the database:
await using var db = ProcessorMeta.ServiceProvider.GetRequiredService<DataContext>(); await using var db = ProcessorMeta.ServiceProvider.GetRequiredService<DataContext>();