diff options
author | Justin Clark-Casey (justincc) | 2012-05-04 22:57:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-04 22:57:33 +0100 |
commit | dec6ad2933f75d4ac475a5e1c4302fe758c60d6d (patch) | |
tree | a55aba1a71f67f3e026d67529353a341d217d53a /OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |
parent | Temporarily add debug log lines to lsl url request and release (diff) | |
download | opensim-SC_OLD-dec6ad2933f75d4ac475a5e1c4302fe758c60d6d.zip opensim-SC_OLD-dec6ad2933f75d4ac475a5e1c4302fe758c60d6d.tar.gz opensim-SC_OLD-dec6ad2933f75d4ac475a5e1c4302fe758c60d6d.tar.bz2 opensim-SC_OLD-dec6ad2933f75d4ac475a5e1c4302fe758c60d6d.tar.xz |
Don't try and update the access time of a file that is actively being cached.
This may cause IOErrors on Windows.
Aims to help with http://opensimulator.org/mantis/view.php?id=6003
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 389fb7b..a25976d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -261,10 +261,14 @@ namespace Flotsam.RegionModules.AssetCache | |||
261 | 261 | ||
262 | try | 262 | try |
263 | { | 263 | { |
264 | // If the file is already cached, don't cache it, just touch it so access time is updated | 264 | // If the file is already cached just update access time. |
265 | if (File.Exists(filename)) | 265 | if (File.Exists(filename)) |
266 | { | 266 | { |
267 | File.SetLastAccessTime(filename, DateTime.Now); | 267 | lock (m_CurrentlyWriting) |
268 | { | ||
269 | if (!m_CurrentlyWriting.Contains(filename)) | ||
270 | File.SetLastAccessTime(filename, DateTime.Now); | ||
271 | } | ||
268 | } | 272 | } |
269 | else | 273 | else |
270 | { | 274 | { |