aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Materials
diff options
context:
space:
mode:
authorUbitUmarov2019-06-14 20:12:33 +0100
committerUbitUmarov2019-06-14 20:12:33 +0100
commit05f508229ce2938f3f88510080f5b65ed5a9b324 (patch)
tree93574a1f343c0fdb030b27a36017699f8f80e579 /OpenSim/Region/OptionalModules/Materials
parenthandle confirmXfer sync (diff)
downloadopensim-SC-05f508229ce2938f3f88510080f5b65ed5a9b324.zip
opensim-SC-05f508229ce2938f3f88510080f5b65ed5a9b324.tar.gz
opensim-SC-05f508229ce2938f3f88510080f5b65ed5a9b324.tar.bz2
opensim-SC-05f508229ce2938f3f88510080f5b65ed5a9b324.tar.xz
make materials save to grid less async on manual backup or shutdown
Diffstat (limited to 'OpenSim/Region/OptionalModules/Materials')
-rw-r--r--OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs21
1 files changed, 17 insertions, 4 deletions
diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
index 822439f..2aea7f9 100644
--- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
+++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
@@ -133,7 +133,7 @@ namespace OpenSim.Region.OptionalModules.Materials
133 if(m_changed.Count == 0) 133 if(m_changed.Count == 0)
134 return; 134 return;
135 135
136 if(forcedBackup) 136 if (forcedBackup)
137 { 137 {
138 toStore = new List<FaceMaterial>(m_changed.Keys); 138 toStore = new List<FaceMaterial>(m_changed.Keys);
139 m_changed.Clear(); 139 m_changed.Clear();
@@ -154,16 +154,29 @@ namespace OpenSim.Region.OptionalModules.Materials
154 m_changed.Remove(fm); 154 m_changed.Remove(fm);
155 } 155 }
156 } 156 }
157 }
157 158
158 if(toStore.Count > 0) 159 if(toStore.Count > 0)
159 Util.FireAndForget(delegate 160 {
161 if (forcedBackup)
160 { 162 {
161 foreach(FaceMaterial fm in toStore) 163 foreach (FaceMaterial fm in toStore)
162 { 164 {
163 AssetBase a = MakeAsset(fm, false); 165 AssetBase a = MakeAsset(fm, false);
164 m_scene.AssetService.Store(a); 166 m_scene.AssetService.Store(a);
165 } 167 }
166 }); 168 }
169 else
170 {
171 Util.FireAndForget(delegate
172 {
173 foreach (FaceMaterial fm in toStore)
174 {
175 AssetBase a = MakeAsset(fm, false);
176 m_scene.AssetService.Store(a);
177 }
178 });
179 }
167 } 180 }
168 } 181 }
169 182