diff --git a/server/Tingle.Dependabot/Extensions/ConfigurationManagerExtensions.cs b/server/Tingle.Dependabot/Extensions/ConfigurationManagerExtensions.cs index ce5a176c..8ff90a7a 100644 --- a/server/Tingle.Dependabot/Extensions/ConfigurationManagerExtensions.cs +++ b/server/Tingle.Dependabot/Extensions/ConfigurationManagerExtensions.cs @@ -16,26 +16,24 @@ public static ConfigurationManager AddStandardAzureAppConfiguration(this Configu var section = manager.GetSection("AzureAppConfig"); var endpoint = section.GetValue("Endpoint"); var label = section.GetValue("Label") ?? environment.EnvironmentName; - if (endpoint is not null) + if (endpoint is null) return manager; + + var refreshInterval = section.GetValue("RefreshInterval") ?? TimeSpan.FromHours(1); + manager.AddAzureAppConfiguration(options => { - var cacheExpiration = section.GetValue("CacheExpiration") ?? TimeSpan.FromHours(1); - var cacheExpirationInterval = section.GetValue("CacheExpirationInterval") ?? TimeSpan.FromMinutes(30); - manager.AddAzureAppConfiguration(options => - { - options.Connect(endpoint: endpoint, credential: new DefaultAzureCredential()) - .Select("*", label) - .ConfigureRefresh(o => - { - o.Register("Refresh", label, refreshAll: true) // key to use to trigger refresh - .SetCacheExpiration(cacheExpiration); - }) - .UseFeatureFlags(o => - { - o.Label = label; - o.CacheExpirationInterval = cacheExpirationInterval; - }); - }); - } + options.Connect(endpoint: endpoint, credential: new DefaultAzureCredential()) + .Select("*", label) + .ConfigureRefresh(o => + { + o.Register("Refresh", label, refreshAll: true); // key to use to trigger refresh + o.SetRefreshInterval(refreshInterval); + }) + .UseFeatureFlags(o => + { + o.Label = label; + o.SetRefreshInterval(refreshInterval); + }); + }); return manager; }