On OAR saving, try fetch assets serially rather than firing all the requests at the asset service at once.

This may (or may not) improve reliability for http://opensimulator.org/mantis/view.php?id=5898
Quick tests show that save time is the same.
0.7.4.1
Justin Clark-Casey (justincc) 2012-03-10 02:03:07 +00:00
parent 3a5928f813
commit 1693799623
2 changed files with 19 additions and 10 deletions

View File

@ -219,12 +219,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
if (SaveAssets)
new AssetsRequest(
new AssetsArchiver(archiveWriter), assetUuids,
m_scene.AssetService, m_scene.UserAccountService,
m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets).Execute();
{
AssetsRequest ar
= new AssetsRequest(
new AssetsArchiver(archiveWriter), assetUuids,
m_scene.AssetService, m_scene.UserAccountService,
m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets);
Util.FireAndForget(o => ar.Execute());
}
else
awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>());
{
Util.FireAndForget(o => awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>()));
}
}
catch (Exception)
{

View File

@ -141,13 +141,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
PerformAssetsRequestCallback(null);
return;
}
foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
{
m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
}
m_requestCallbackTimer.Enabled = true;
foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
{
// m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
AssetBase asset = m_assetService.Get(kvp.Key.ToString());
PreAssetRequestCallback(kvp.Key.ToString(), kvp.Value, asset);
}
}
protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)