diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 17 |
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 | ||