diff options
author | Justin Clark-Casey (justincc) | 2011-02-25 01:25:38 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-02-25 01:25:38 +0000 |
commit | 939c47ac521dee943083d87abe70a7271ee78077 (patch) | |
tree | d26a328aa97bcce83a2537fdc8698794bf6f7290 /OpenSim/Region | |
parent | log actual cache directory for FlotsamAssetCache instead of always logging th... (diff) | |
download | opensim-SC_OLD-939c47ac521dee943083d87abe70a7271ee78077.zip opensim-SC_OLD-939c47ac521dee943083d87abe70a7271ee78077.tar.gz opensim-SC_OLD-939c47ac521dee943083d87abe70a7271ee78077.tar.bz2 opensim-SC_OLD-939c47ac521dee943083d87abe70a7271ee78077.tar.xz |
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
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 90fb9b3..02a4e4d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -92,7 +92,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
92 | // Expiration is expressed in hours. | 92 | // Expiration is expressed in hours. |
93 | private const double m_DefaultMemoryExpiration = 1.0; | 93 | private const double m_DefaultMemoryExpiration = 1.0; |
94 | private const double m_DefaultFileExpiration = 48; | 94 | private const double m_DefaultFileExpiration = 48; |
95 | private TimeSpan m_MemoryExpiration = TimeSpan.Zero; | 95 | private TimeSpan m_MemoryExpiration = TimeSpan.FromHours(m_DefaultMemoryExpiration); |
96 | private TimeSpan m_FileExpiration = TimeSpan.Zero; | 96 | private TimeSpan m_FileExpiration = TimeSpan.Zero; |
97 | private TimeSpan m_FileExpirationCleanupTimer = TimeSpan.Zero; | 97 | private TimeSpan m_FileExpirationCleanupTimer = TimeSpan.Zero; |
98 | 98 | ||
@@ -245,16 +245,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
245 | private void UpdateMemoryCache(string key, AssetBase asset) | 245 | private void UpdateMemoryCache(string key, AssetBase asset) |
246 | { | 246 | { |
247 | if (m_MemoryCacheEnabled) | 247 | if (m_MemoryCacheEnabled) |
248 | { | 248 | m_MemoryCache.AddOrUpdate(key, asset, m_MemoryExpiration); |
249 | if (m_MemoryExpiration > TimeSpan.Zero) | ||
250 | { | ||
251 | m_MemoryCache.AddOrUpdate(key, asset, m_MemoryExpiration); | ||
252 | } | ||
253 | else | ||
254 | { | ||
255 | m_MemoryCache.AddOrUpdate(key, asset, m_DefaultMemoryExpiration); | ||
256 | } | ||
257 | } | ||
258 | } | 249 | } |
259 | 250 | ||
260 | public void Cache(AssetBase asset) | 251 | public void Cache(AssetBase asset) |