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 code0.7.1-dev
parent
beff0ac32f
commit
939c47ac52
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue