aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-11-24 17:47:09 +0000
committerJustin Clark-Casey (justincc)2009-11-24 17:47:09 +0000
commitc083ab682425d13a7369e3f82c82ccbc3c65102a (patch)
tree6bc52c9aaa6a45d44c2152eceb3301b8e9e2bcc6 /OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
parentminor: remove some mono compiler warnings (diff)
downloadopensim-SC_OLD-c083ab682425d13a7369e3f82c82ccbc3c65102a.zip
opensim-SC_OLD-c083ab682425d13a7369e3f82c82ccbc3c65102a.tar.gz
opensim-SC_OLD-c083ab682425d13a7369e3f82c82ccbc3c65102a.tar.bz2
opensim-SC_OLD-c083ab682425d13a7369e3f82c82ccbc3c65102a.tar.xz
make save and load oar slightly more robust by always closing the archive streams even if there has been an error
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs22
1 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
index f039be8..75c4557 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -80,6 +80,22 @@ namespace OpenSim.Region.CoreModules.World.Archiver
80 protected internal void ReceivedAllAssets( 80 protected internal void ReceivedAllAssets(
81 ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) 81 ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
82 { 82 {
83 try
84 {
85 Save(assetsFoundUuids, assetsNotFoundUuids);
86 }
87 finally
88 {
89 m_archiveWriter.Close();
90 }
91
92 m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_scene.RegionInfo.RegionName);
93
94 m_scene.EventManager.TriggerOarFileSaved(m_requestId, String.Empty);
95 }
96
97 protected internal void Save(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
98 {
83 foreach (UUID uuid in assetsNotFoundUuids) 99 foreach (UUID uuid in assetsNotFoundUuids)
84 { 100 {
85 m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); 101 m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid);
@@ -143,12 +159,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
143 } 159 }
144 160
145 m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive."); 161 m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive.");
146
147 m_archiveWriter.Close();
148
149 m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_scene.RegionInfo.RegionName);
150
151 m_scene.EventManager.TriggerOarFileSaved(m_requestId, String.Empty);
152 } 162 }
153 163
154 /// <summary> 164 /// <summary>