|
|
@ -84,6 +84,7 @@ namespace NzbDrone.Common.Test.CacheTests
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
|
|
|
|
[Platform(Exclude = "MacOsX")]
|
|
|
|
public void should_honor_ttl()
|
|
|
|
public void should_honor_ttl()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int hitCount = 0;
|
|
|
|
int hitCount = 0;
|
|
|
@ -92,10 +93,10 @@ namespace NzbDrone.Common.Test.CacheTests
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_cachedString.Get("key", () =>
|
|
|
|
_cachedString.Get("key", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
hitCount++;
|
|
|
|
hitCount++;
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}, TimeSpan.FromMilliseconds(300));
|
|
|
|
}, TimeSpan.FromMilliseconds(300));
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
Thread.Sleep(100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|