Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename slidingexpiration to match what's used in asp net #254

Merged
merged 1 commit into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MsalMemoryTokenCacheOptions
/// By default, the sliding expiration is set for 14 days.</summary>
public MsalMemoryTokenCacheOptions()
{
SlidingExpiration = TimeSpan.FromDays(14);
AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(14);
}

/// <summary>
Expand All @@ -23,12 +23,12 @@ public MsalMemoryTokenCacheOptions()
/// In production, a higher value, up-to 90 days is recommended.
/// </summary>
/// <value>
/// The SlidingExpiration value.
/// The AbsoluteExpirationRelativeToNow value.
/// </value>
public TimeSpan SlidingExpiration
public TimeSpan AbsoluteExpirationRelativeToNow
{
get;
set;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected override Task<byte[]> ReadCacheBytesAsync(string cacheKey)
/// <param name="bytes">Bytes to write.</param>
protected override Task WriteCacheBytesAsync(string cacheKey, byte[] bytes)
{
_memoryCache.Set(cacheKey, bytes, _cacheOptions.SlidingExpiration);
_memoryCache.Set(cacheKey, bytes, _cacheOptions.AbsoluteExpirationRelativeToNow);
return Task.CompletedTask;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected override Task RemoveKeyAsync(string cacheKey)

protected override Task WriteCacheBytesAsync(string cacheKey, byte[] bytes)
{
MemoryCache.Set(cacheKey, bytes, _cacheOptions.SlidingExpiration);
MemoryCache.Set(cacheKey, bytes, _cacheOptions.AbsoluteExpirationRelativeToNow);
Count++;
return Task.CompletedTask;
}
Expand Down