diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | 13 |
2 files changed, 22 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 863560b..c48186f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -203,21 +203,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
203 | 203 | ||
204 | void OnClientClosed(UUID clientID, Scene scene) | 204 | void OnClientClosed(UUID clientID, Scene scene) |
205 | { | 205 | { |
206 | if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache | 206 | ScenePresence sp = null; |
207 | foreach (Scene s in m_Scenes) | ||
207 | { | 208 | { |
208 | ScenePresence sp = null; | 209 | s.TryGetScenePresence(clientID, out sp); |
209 | foreach (Scene s in m_Scenes) | 210 | if ((sp != null) && !sp.IsChildAgent && (s != scene)) |
210 | { | 211 | { |
211 | s.TryGetScenePresence(clientID, out sp); | 212 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache", |
212 | if ((sp != null) && !sp.IsChildAgent && (s != scene)) | ||
213 | { | ||
214 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache", | ||
215 | scene.RegionInfo.RegionName, clientID); | 213 | scene.RegionInfo.RegionName, clientID); |
216 | return; | 214 | return; |
217 | } | ||
218 | } | 215 | } |
219 | DropInventoryServiceURL(clientID); | ||
220 | } | 216 | } |
217 | |||
218 | if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache | ||
219 | DropInventoryServiceURL(clientID); | ||
220 | |||
221 | m_Cache.RemoveAll(clientID); | ||
221 | } | 222 | } |
222 | 223 | ||
223 | /// <summary> | 224 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 3195e6b..f7ef2ea 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | |||
@@ -38,12 +38,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
38 | /// </summary> | 38 | /// </summary> |
39 | public class InventoryCache | 39 | public class InventoryCache |
40 | { | 40 | { |
41 | private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour | 41 | private const double CACHE_EXPIRATION_SECONDS = 60.0; // 1 minute |
42 | 42 | ||
43 | private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>(); | 43 | private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>(); |
44 | private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>(); | 44 | private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>(); |
45 | private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>(); | 45 | private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>(); |
46 | 46 | ||
47 | |||
48 | public void RemoveAll(UUID userID) | ||
49 | { | ||
50 | if(m_RootFolders.Contains(userID)) | ||
51 | m_RootFolders.Remove(userID); | ||
52 | if(m_FolderTypes.Contains(userID)) | ||
53 | m_FolderTypes.Remove(userID); | ||
54 | if(m_Inventories.Contains(userID)) | ||
55 | m_Inventories.Remove(userID); | ||
56 | } | ||
57 | |||
47 | public void Cache(UUID userID, InventoryFolderBase root) | 58 | public void Cache(UUID userID, InventoryFolderBase root) |
48 | { | 59 | { |
49 | m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS); | 60 | m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS); |