in some cases store a hg asset on local grid is just waste

This commit is contained in:
UbitUmarov
2020-10-28 12:12:08 +00:00
parent 52c86e543f
commit 7b106564fa
14 changed files with 67 additions and 55 deletions

View File

@@ -562,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Asset
return asset;
}
public AssetBase Get(string id, string ForeignAssetService)
public AssetBase Get(string id, string ForeignAssetService, bool dummy)
{
return null;
}
@@ -630,9 +630,51 @@ namespace OpenSim.Region.CoreModules.Asset
return false;
}
// does not check negative cache
public AssetBase GetCached(string id)
{
Get(id, out AssetBase asset);
AssetBase asset = null;
m_Requests++;
asset = GetFromWeakReference(id);
if (asset != null)
{
if (m_updateFileTimeOnCacheHit)
{
string filename = GetFileName(id);
UpdateFileLastAccessTime(filename);
}
if (m_MemoryCacheEnabled)
UpdateMemoryCache(id, asset);
return asset;
}
if (m_MemoryCacheEnabled)
{
asset = GetFromMemoryCache(id);
if (asset != null)
{
UpdateWeakReference(id, asset);
if (m_updateFileTimeOnCacheHit)
{
string filename = GetFileName(id);
UpdateFileLastAccessTime(filename);
}
return asset;
}
}
if (m_FileCacheEnabled)
{
asset = GetFromFileCache(id);
if (asset != null)
{
UpdateWeakReference(id, asset);
if (m_MemoryCacheEnabled)
UpdateMemoryCache(id, asset);
}
}
return asset;
}