refactor: breakout flotasm cache last file access time to separate UpdateFileLastAccessTime() method for imminent reuse.
parent
c36bfdc60f
commit
ad91143880
|
@ -256,13 +256,7 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||||
// If the file is already cached, don't cache it, just touch it so access time is updated
|
// If the file is already cached, don't cache it, just touch it so access time is updated
|
||||||
if (File.Exists(filename))
|
if (File.Exists(filename))
|
||||||
{
|
{
|
||||||
try
|
UpdateFileLastAccessTime(filename);
|
||||||
{
|
|
||||||
File.SetLastAccessTime(filename, DateTime.Now);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -321,6 +315,24 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the cached file with the current time.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filename">Filename.</param>
|
||||||
|
/// <returns><c>true</c>, if the update was successful, false otherwise.</returns>
|
||||||
|
private bool UpdateFileLastAccessTime(string filename)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.SetLastAccessTime(filename, DateTime.Now);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to get an asset from the in-memory cache.
|
/// Try to get an asset from the in-memory cache.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue