diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index bc5b39b..7780568 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -256,13 +256,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
256 | // If the file is already cached, don't cache it, just touch it so access time is updated | 256 | // If the file is already cached, don't cache it, just touch it so access time is updated |
257 | if (File.Exists(filename)) | 257 | if (File.Exists(filename)) |
258 | { | 258 | { |
259 | try | 259 | UpdateFileLastAccessTime(filename); |
260 | { | ||
261 | File.SetLastAccessTime(filename, DateTime.Now); | ||
262 | } | ||
263 | catch | ||
264 | { | ||
265 | } | ||
266 | } | 260 | } |
267 | else | 261 | else |
268 | { | 262 | { |
@@ -322,6 +316,24 @@ namespace OpenSim.Region.CoreModules.Asset | |||
322 | } | 316 | } |
323 | 317 | ||
324 | /// <summary> | 318 | /// <summary> |
319 | /// Updates the cached file with the current time. | ||
320 | /// </summary> | ||
321 | /// <param name="filename">Filename.</param> | ||
322 | /// <returns><c>true</c>, if the update was successful, false otherwise.</returns> | ||
323 | private bool UpdateFileLastAccessTime(string filename) | ||
324 | { | ||
325 | try | ||
326 | { | ||
327 | File.SetLastAccessTime(filename, DateTime.Now); | ||
328 | return true; | ||
329 | } | ||
330 | catch | ||
331 | { | ||
332 | return false; | ||
333 | } | ||
334 | } | ||
335 | |||
336 | /// <summary> | ||
325 | /// Try to get an asset from the in-memory cache. | 337 | /// Try to get an asset from the in-memory cache. |
326 | /// </summary> | 338 | /// </summary> |
327 | /// <param name="id"></param> | 339 | /// <param name="id"></param> |