mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
in some cases store a hg asset on local grid is just waste
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user