diff options
author | Justin Clark-Casey (justincc) | 2012-03-10 02:03:07 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-10 02:03:07 +0000 |
commit | 16937996231aef5efa4c12fa51b84bc8273c76f7 (patch) | |
tree | a37b733462c546d1eacec389a743585fe0cbb1f7 /OpenSim/Region/CoreModules/World/Archiver | |
parent | Add satguru and Fernando to contributors (diff) | |
download | opensim-SC_OLD-16937996231aef5efa4c12fa51b84bc8273c76f7.zip opensim-SC_OLD-16937996231aef5efa4c12fa51b84bc8273c76f7.tar.gz opensim-SC_OLD-16937996231aef5efa4c12fa51b84bc8273c76f7.tar.bz2 opensim-SC_OLD-16937996231aef5efa4c12fa51b84bc8273c76f7.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | 10 |
2 files changed, 18 insertions, 9 deletions
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 | |||
219 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | 219 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); |
220 | 220 | ||
221 | if (SaveAssets) | 221 | if (SaveAssets) |
222 | new AssetsRequest( | 222 | { |
223 | new AssetsArchiver(archiveWriter), assetUuids, | 223 | AssetsRequest ar |
224 | m_scene.AssetService, m_scene.UserAccountService, | 224 | = new AssetsRequest( |
225 | m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets).Execute(); | 225 | new AssetsArchiver(archiveWriter), assetUuids, |
226 | m_scene.AssetService, m_scene.UserAccountService, | ||
227 | m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets); | ||
228 | |||
229 | Util.FireAndForget(o => ar.Execute()); | ||
230 | } | ||
226 | else | 231 | else |
227 | awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>()); | 232 | { |
233 | Util.FireAndForget(o => awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>())); | ||
234 | } | ||
228 | } | 235 | } |
229 | catch (Exception) | 236 | catch (Exception) |
230 | { | 237 | { |
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 | |||
141 | PerformAssetsRequestCallback(null); | 141 | PerformAssetsRequestCallback(null); |
142 | return; | 142 | return; |
143 | } | 143 | } |
144 | 144 | ||
145 | m_requestCallbackTimer.Enabled = true; | ||
146 | |||
145 | foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) | 147 | foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) |
146 | { | 148 | { |
147 | m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); | 149 | // m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); |
150 | AssetBase asset = m_assetService.Get(kvp.Key.ToString()); | ||
151 | PreAssetRequestCallback(kvp.Key.ToString(), kvp.Value, asset); | ||
148 | } | 152 | } |
149 | |||
150 | m_requestCallbackTimer.Enabled = true; | ||
151 | } | 153 | } |
152 | 154 | ||
153 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) | 155 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) |