Skip to content

Commit c18384c

Browse files
committed
Pulling out constants and adding notes to summary
1 parent d2209ae commit c18384c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Microsoft.FeatureManagement/ConfigurationWrapper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
namespace Microsoft.FeatureManagement
1010
{
1111
/// <summary>
12-
/// Wraps an instance of IConfiguration.
12+
/// Wraps an instance of IConfiguration. This allows the reference to be updated when the underlying IConfiguration is updated.
13+
/// This is useful for cache busting based on the reference.
1314
/// </summary>
1415
class ConfigurationWrapper : IConfiguration
1516
{

src/Microsoft.FeatureManagement/FeatureManager.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ namespace Microsoft.FeatureManagement
1818
/// </summary>
1919
class FeatureManager : IFeatureManager, IDisposable
2020
{
21+
private readonly TimeSpan ParametersCacheSlidingExpiration = TimeSpan.FromMinutes(5);
22+
private readonly TimeSpan ParametersCacheAbsoluteExpirationRelativeToNow = TimeSpan.FromDays(1);
23+
2124
private readonly IFeatureDefinitionProvider _featureDefinitionProvider;
2225
private readonly IEnumerable<IFeatureFilterMetadata> _featureFilters;
2326
private readonly IEnumerable<ISessionManager> _sessionManagers;
@@ -248,8 +251,8 @@ private void BindSettings(IFeatureFilterMetadata filter, FeatureFilterEvaluation
248251
},
249252
new MemoryCacheEntryOptions
250253
{
251-
SlidingExpiration = TimeSpan.FromMinutes(5),
252-
AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(1)
254+
SlidingExpiration = ParametersCacheSlidingExpiration,
255+
AbsoluteExpirationRelativeToNow = ParametersCacheAbsoluteExpirationRelativeToNow
253256
});
254257
}
255258
}

0 commit comments

Comments
 (0)