aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
diff options
context:
space:
mode:
authordiva2009-06-09 20:20:30 +0000
committerdiva2009-06-09 20:20:30 +0000
commitca52c3ef26d82e286eb9e2e6bf67eb2d876a5ed1 (patch)
tree19894c7b8ee7883928614ffc0548dfdf3ae704ff /OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
parentFormatting cleanup. Ignore some generated files. (diff)
downloadopensim-SC_OLD-ca52c3ef26d82e286eb9e2e6bf67eb2d876a5ed1.zip
opensim-SC_OLD-ca52c3ef26d82e286eb9e2e6bf67eb2d876a5ed1.tar.gz
opensim-SC_OLD-ca52c3ef26d82e286eb9e2e6bf67eb2d876a5ed1.tar.bz2
opensim-SC_OLD-ca52c3ef26d82e286eb9e2e6bf67eb2d876a5ed1.tar.xz
Letting the Flotsam cache be enabled even when [AssetCache] section is missing. Thank you mcortez!
Diffstat (limited to 'OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs')
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index b7c269d..d09f5ef 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -161,17 +161,17 @@ namespace Flotsam.RegionModules.AssetCache
161 161
162 if (name == Name) 162 if (name == Name)
163 { 163 {
164 m_Enabled = true;
165 m_log.InfoFormat("[ASSET CACHE]: {0} enabled", this.Name);
166
164 IConfig assetConfig = source.Configs["AssetCache"]; 167 IConfig assetConfig = source.Configs["AssetCache"];
165 if (assetConfig == null) 168 if (assetConfig == null)
166 { 169 {
167 m_log.Error("[ASSET CACHE]: AssetCache missing from OpenSim.ini"); 170 m_log.Warn("[ASSET CACHE]: AssetCache missing from OpenSim.ini, using defaults.");
171 m_log.InfoFormat("[ASSET CACHE]: Cache Directory", m_DefaultCacheDirectory);
168 return; 172 return;
169 } 173 }
170 174
171 m_Enabled = true;
172
173 m_log.InfoFormat("[ASSET CACHE]: {0} enabled", this.Name);
174
175 m_CacheDirectory = assetConfig.GetString("CacheDirectory", m_DefaultCacheDirectory); 175 m_CacheDirectory = assetConfig.GetString("CacheDirectory", m_DefaultCacheDirectory);
176 m_log.InfoFormat("[ASSET CACHE]: Cache Directory", m_DefaultCacheDirectory); 176 m_log.InfoFormat("[ASSET CACHE]: Cache Directory", m_DefaultCacheDirectory);
177 177
@@ -182,6 +182,7 @@ namespace Flotsam.RegionModules.AssetCache
182 m_WaitOnInprogressTimeout = assetConfig.GetInt("WaitOnInprogressTimeout", 3000); 182 m_WaitOnInprogressTimeout = assetConfig.GetInt("WaitOnInprogressTimeout", 3000);
183#endif 183#endif
184 184
185 m_LogLevel = assetConfig.GetInt("LogLevel", 1);
185 m_HitRateDisplay = (ulong)assetConfig.GetInt("HitRateDisplay", 1); 186 m_HitRateDisplay = (ulong)assetConfig.GetInt("HitRateDisplay", 1);
186 187
187 m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration)); 188 m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration));
@@ -230,7 +231,7 @@ namespace Flotsam.RegionModules.AssetCache
230 231
231 private void UpdateMemoryCache(string key, AssetBase asset) 232 private void UpdateMemoryCache(string key, AssetBase asset)
232 { 233 {
233 if (m_MemoryCacheEnabled) 234 if( m_MemoryCacheEnabled )
234 { 235 {
235 if (m_MemoryExpiration > TimeSpan.Zero) 236 if (m_MemoryExpiration > TimeSpan.Zero)
236 { 237 {
@@ -404,7 +405,7 @@ namespace Flotsam.RegionModules.AssetCache
404 File.Delete(filename); 405 File.Delete(filename);
405 } 406 }
406 407
407 if (m_MemoryCacheEnabled) 408 if( m_MemoryCacheEnabled )
408 m_MemoryCache.Remove(id); 409 m_MemoryCache.Remove(id);
409 } 410 }
410 catch (Exception e) 411 catch (Exception e)
@@ -423,7 +424,7 @@ namespace Flotsam.RegionModules.AssetCache
423 Directory.Delete(dir); 424 Directory.Delete(dir);
424 } 425 }
425 426
426 if (m_MemoryCacheEnabled) 427 if( m_MemoryCacheEnabled )
427 m_MemoryCache.Clear(); 428 m_MemoryCache.Clear();
428 } 429 }
429 430