instead of using different default memory expiration depending on whether there is a [FLOTSAM ASSET CACHE] section present at all, use the same default all the time

this simplifies the code
0.7.1-dev
Justin Clark-Casey (justincc) 2011-02-25 01:25:38 +00:00
parent beff0ac32f
commit 939c47ac52
1 changed files with 2 additions and 11 deletions

View File

@ -92,7 +92,7 @@ namespace Flotsam.RegionModules.AssetCache
// Expiration is expressed in hours.
private const double m_DefaultMemoryExpiration = 1.0;
private const double m_DefaultFileExpiration = 48;
private TimeSpan m_MemoryExpiration = TimeSpan.Zero;
private TimeSpan m_MemoryExpiration = TimeSpan.FromHours(m_DefaultMemoryExpiration);
private TimeSpan m_FileExpiration = TimeSpan.Zero;
private TimeSpan m_FileExpirationCleanupTimer = TimeSpan.Zero;
@ -245,16 +245,7 @@ namespace Flotsam.RegionModules.AssetCache
private void UpdateMemoryCache(string key, AssetBase asset)
{
if (m_MemoryCacheEnabled)
{
if (m_MemoryExpiration > TimeSpan.Zero)
{
m_MemoryCache.AddOrUpdate(key, asset, m_MemoryExpiration);
}
else
{
m_MemoryCache.AddOrUpdate(key, asset, m_DefaultMemoryExpiration);
}
}
m_MemoryCache.AddOrUpdate(key, asset, m_MemoryExpiration);
}
public void Cache(AssetBase asset)