Adjusted cache to allow for throttling and locking.
This commit is contained in:
@@ -6,19 +6,12 @@ public abstract class MemoryCache<TKey, TValue> : Cache<TKey, TValue> where TKey
|
||||
{
|
||||
private readonly IMemoryCache _memoryCache;
|
||||
|
||||
protected abstract long? SizeLimit { get; }
|
||||
protected abstract double CompactionPercentage { get; }
|
||||
protected abstract MemoryCacheOptions Options { get; }
|
||||
protected abstract TimeSpan SlidingExpiration { get; }
|
||||
|
||||
public MemoryCache()
|
||||
{
|
||||
MemoryCacheOptions memoryCacheOptions = new()
|
||||
{
|
||||
SizeLimit = SizeLimit,
|
||||
CompactionPercentage = CompactionPercentage
|
||||
};
|
||||
|
||||
_memoryCache = new MemoryCache(memoryCacheOptions);
|
||||
_memoryCache = new MemoryCache(Options);
|
||||
}
|
||||
|
||||
protected override TValue? TryGetValue(object key)
|
||||
|
||||
Reference in New Issue
Block a user