diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Asset')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 127ca1d..7d7176f 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -83,7 +83,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
83 | private Dictionary<string, ManualResetEvent> m_CurrentlyWriting = new Dictionary<string, ManualResetEvent>(); | 83 | private Dictionary<string, ManualResetEvent> m_CurrentlyWriting = new Dictionary<string, ManualResetEvent>(); |
84 | private int m_WaitOnInprogressTimeout = 3000; | 84 | private int m_WaitOnInprogressTimeout = 3000; |
85 | #else | 85 | #else |
86 | private List<string> m_CurrentlyWriting = new List<string>(); | 86 | private HashSet<string> m_CurrentlyWriting = new HashSet<string>(); |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | private bool m_FileCacheEnabled = true; | 89 | private bool m_FileCacheEnabled = true; |
@@ -143,7 +143,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
143 | IConfig assetConfig = source.Configs["AssetCache"]; | 143 | IConfig assetConfig = source.Configs["AssetCache"]; |
144 | if (assetConfig == null) | 144 | if (assetConfig == null) |
145 | { | 145 | { |
146 | m_log.Warn( | 146 | m_log.Debug( |
147 | "[FLOTSAM ASSET CACHE]: AssetCache section missing from config (not copied config-include/FlotsamCache.ini.example? Using defaults."); | 147 | "[FLOTSAM ASSET CACHE]: AssetCache section missing from config (not copied config-include/FlotsamCache.ini.example? Using defaults."); |
148 | } | 148 | } |
149 | else | 149 | else |
@@ -272,7 +272,11 @@ namespace Flotsam.RegionModules.AssetCache | |||
272 | // the other thread has updated the time for us. | 272 | // the other thread has updated the time for us. |
273 | try | 273 | try |
274 | { | 274 | { |
275 | File.SetLastAccessTime(filename, DateTime.Now); | 275 | lock (m_CurrentlyWriting) |
276 | { | ||
277 | if (!m_CurrentlyWriting.Contains(filename)) | ||
278 | File.SetLastAccessTime(filename, DateTime.Now); | ||
279 | } | ||
276 | } | 280 | } |
277 | catch | 281 | catch |
278 | { | 282 | { |
diff --git a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs index 5adb845..c91b25f 100644 --- a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs +++ b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Asset.Tests | |||
65 | config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true"); | 65 | config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true"); |
66 | 66 | ||
67 | m_cache = new FlotsamAssetCache(); | 67 | m_cache = new FlotsamAssetCache(); |
68 | m_scene = SceneHelpers.SetupScene(); | 68 | m_scene = new SceneHelpers().SetupScene(); |
69 | SceneHelpers.SetupSceneModules(m_scene, config, m_cache); | 69 | SceneHelpers.SetupSceneModules(m_scene, config, m_cache); |
70 | } | 70 | } |
71 | 71 | ||