mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
added new in memory cache.
This commit is contained in:
parent
d1eec340e0
commit
098036d49a
7 changed files with 202 additions and 0 deletions
22
NzbDrone.Common/Cache/CacheManger.cs
Normal file
22
NzbDrone.Common/Cache/CacheManger.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using NzbDrone.Common.EnsureThat;
|
||||
|
||||
namespace NzbDrone.Common.Cache
|
||||
{
|
||||
public static class CacheManger
|
||||
{
|
||||
private static readonly ICached<object> Cache;
|
||||
|
||||
static CacheManger()
|
||||
{
|
||||
Cache = new Cached<object>();
|
||||
}
|
||||
|
||||
public static ICached<T> GetCache<T>(Type type)
|
||||
{
|
||||
Ensure.That(() => type).IsNotNull();
|
||||
|
||||
return (ICached<T>)Cache.Get(type.FullName, () => new Cached<T>());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue