Make the asset retrieval concurrency a config switch. The current value

of 30 is still hanging badly on some mono versions. The switch defaults to
30 to preserve current behavior.
This commit is contained in:
Mic Bowman
2012-10-04 08:41:06 -07:00
parent b977f962fa
commit d98af79f77
2 changed files with 12 additions and 3 deletions

View File

@@ -47,7 +47,8 @@ namespace OpenSim.Services.Connectors
private string m_ServerURI = String.Empty;
private IImprovedAssetCache m_Cache = null;
private int m_maxAssetRequestConcurrency = 30;
private delegate void AssetRetrievedEx(AssetBase asset);
// Keeps track of concurrent requests for the same asset, so that it's only loaded once.
@@ -71,6 +72,10 @@ namespace OpenSim.Services.Connectors
public virtual void Initialise(IConfigSource source)
{
IConfig netconfig = source.Configs["Network"];
if (netconfig != null)
m_maxAssetRequestConcurrency = netconfig.GetInt("MaxRequestConcurrency",m_maxAssetRequestConcurrency);
IConfig assetConfig = source.Configs["AssetService"];
if (assetConfig == null)
{
@@ -108,7 +113,7 @@ namespace OpenSim.Services.Connectors
if (asset == null)
{
asset = SynchronousRestObjectRequester.
MakeRequest<int, AssetBase>("GET", uri, 0, 30);
MakeRequest<int, AssetBase>("GET", uri, 0, m_maxAssetRequestConcurrency);
if (m_Cache != null)
m_Cache.Cache(asset);
@@ -221,7 +226,7 @@ namespace OpenSim.Services.Connectors
m_AssetHandlers.Remove(id);
}
handlers.Invoke(a);
}, 30);
}, m_maxAssetRequestConcurrency);
success = true;
}