TrackedCommands are cleaned up automatically

TrackedCommandCleanupCommand is not tracked
This commit is contained in:
Mark McDowall
2013-08-30 10:27:17 -07:00
parent 780e374122
commit 56cd80d24a
7 changed files with 64 additions and 14 deletions

View File

@@ -61,6 +61,19 @@ namespace NzbDrone.Common.Cache
return value.Object;
}
public T Remove(string key)
{
CacheItem value;
_store.TryRemove(key, out value);
if (value == null)
{
return default(T);
}
return value.Object;
}
public T Get(string key, Func<T> function, TimeSpan? lifeTime = null)
{
Ensure.That(() => key).IsNotNullOrWhiteSpace();
@@ -81,7 +94,6 @@ namespace NzbDrone.Common.Cache
return value;
}
public void Clear()
{
_store.Clear();