From 16937996231aef5efa4c12fa51b84bc8273c76f7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 10 Mar 2012 02:03:07 +0000 Subject: 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. --- .../World/Archiver/ArchiveWriteRequestPreparation.cs | 17 ++++++++++++----- .../Region/CoreModules/World/Archiver/AssetsRequest.cs | 10 ++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index ffcf063..aef3ad3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -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(), new List()); + { + Util.FireAndForget(o => awre.ReceivedAllAssets(new List(), new List())); + } } catch (Exception) { diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 8e29e3c..55110dc 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs @@ -141,13 +141,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver PerformAssetsRequestCallback(null); return; } - + + m_requestCallbackTimer.Enabled = true; + foreach (KeyValuePair kvp in m_uuids) { - m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); +// m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); + AssetBase asset = m_assetService.Get(kvp.Key.ToString()); + PreAssetRequestCallback(kvp.Key.ToString(), kvp.Value, asset); } - - m_requestCallbackTimer.Enabled = true; } protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) -- cgit v1.1