diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | 13 |
1 files changed, 12 insertions, 1 deletions
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); |