aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-08 22:53:19 +0100
committerJustin Clark-Casey (justincc)2011-07-08 22:53:19 +0100
commitc3d82bdcb1ac2ee0e0bdad75fbf8779252ef31c4 (patch)
tree0e7050a1e23cb9f1bf3ffd23408fcea847ef91ee /OpenSim/Services
parentstop the local inventory services connector from logging an error when an ite... (diff)
downloadopensim-SC-c3d82bdcb1ac2ee0e0bdad75fbf8779252ef31c4.zip
opensim-SC-c3d82bdcb1ac2ee0e0bdad75fbf8779252ef31c4.tar.gz
opensim-SC-c3d82bdcb1ac2ee0e0bdad75fbf8779252ef31c4.tar.bz2
opensim-SC-c3d82bdcb1ac2ee0e0bdad75fbf8779252ef31c4.tar.xz
When loading library asset set, only store an asset if it's different from an existing one with the same id.
We compare existing and loaded asset by doing an SHA1 on both, so that a changed library asset will still update the store. This cuts asset library load time from 10 seconds to <1 sec. Note, a fix on the previous commit revealed a bug where a library script cannot be copied except on the first login after a cache clear. This is unrelated to this commit and needs to be fixed at some subsequent time.
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/AssetService/AssetService.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index 851b7b4..c7a259d 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -84,11 +84,20 @@ namespace OpenSim.Services.AssetService
84 if (assetLoaderEnabled) 84 if (assetLoaderEnabled)
85 { 85 {
86 m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs); 86 m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs);
87 m_AssetLoader.ForEachDefaultXmlAsset(loaderArgs, 87
88 delegate(AssetBase a) 88 m_AssetLoader.ForEachDefaultXmlAsset(
89 loaderArgs,
90 delegate(AssetBase a)
91 {
92 AssetBase existingAsset = Get(a.ID);
93// AssetMetadata existingMetadata = GetMetadata(a.ID);
94
95 if (existingAsset == null || Util.SHA1Hash(existingAsset.Data) != Util.SHA1Hash(a.Data))
89 { 96 {
97// m_log.DebugFormat("[ASSET]: Storing {0} {1}", a.Name, a.ID);
90 Store(a); 98 Store(a);
91 }); 99 }
100 });
92 } 101 }
93 102
94 m_log.Info("[ASSET SERVICE]: Local asset service enabled"); 103 m_log.Info("[ASSET SERVICE]: Local asset service enabled");