diff --git a/src/NzbDrone.Common.Test/CacheTests/CachedFixture.cs b/src/NzbDrone.Common.Test/CacheTests/CachedFixture.cs index 9bb63c7e7..cf3de2d3b 100644 --- a/src/NzbDrone.Common.Test/CacheTests/CachedFixture.cs +++ b/src/NzbDrone.Common.Test/CacheTests/CachedFixture.cs @@ -101,33 +101,6 @@ namespace NzbDrone.Common.Test.CacheTests hitCount.Should().BeInRange(3, 7); } - - [Test] - [Retry(3)] - [Platform(Exclude = "MacOsX")] - public void should_clear_expired_when_they_expire() - { - int hitCount = 0; - _cachedString = new Cached(); - - for (int i = 0; i < 10; i++) - { - _cachedString.Get("key", - () => - { - hitCount++; - return null; - }, - TimeSpan.FromMilliseconds(300)); - - Thread.Sleep(100); - } - - Thread.Sleep(1000); - - hitCount.Should().BeInRange(3, 7); - _cachedString.Values.Should().HaveCount(0); - } } public class Worker diff --git a/src/NzbDrone.Common/Cache/Cached.cs b/src/NzbDrone.Common/Cache/Cached.cs index 8c953190e..2285f548d 100644 --- a/src/NzbDrone.Common/Cache/Cached.cs +++ b/src/NzbDrone.Common/Cache/Cached.cs @@ -39,11 +39,6 @@ namespace NzbDrone.Common.Cache { Ensure.That(key, () => key).IsNotNullOrWhiteSpace(); _store[key] = new CacheItem(value, lifetime); - - if (lifetime != null) - { - System.Threading.Tasks.Task.Delay(lifetime.Value).ContinueWith(t => _store.TryRemove(key, out var temp)); - } } public T Find(string key)