mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user