From 939c47ac521dee943083d87abe70a7271ee78077 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Feb 2011 01:25:38 +0000 Subject: [PATCH] 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 --- .../Region/CoreModules/Asset/FlotsamAssetCache.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 90fb9b3175..02a4e4d979 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -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)