drasticly reduce HG inventory caches Expire times, Remove them all onClientClose. This to avoid potencial desyncs with inventory service
parent
544b859c00
commit
72876fc683
|
@ -202,8 +202,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
#region URL Cache
|
#region URL Cache
|
||||||
|
|
||||||
void OnClientClosed(UUID clientID, Scene scene)
|
void OnClientClosed(UUID clientID, Scene scene)
|
||||||
{
|
|
||||||
if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache
|
|
||||||
{
|
{
|
||||||
ScenePresence sp = null;
|
ScenePresence sp = null;
|
||||||
foreach (Scene s in m_Scenes)
|
foreach (Scene s in m_Scenes)
|
||||||
|
@ -216,8 +214,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache
|
||||||
DropInventoryServiceURL(clientID);
|
DropInventoryServiceURL(clientID);
|
||||||
}
|
|
||||||
|
m_Cache.RemoveAll(clientID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -38,12 +38,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class InventoryCache
|
public class InventoryCache
|
||||||
{
|
{
|
||||||
private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour
|
private const double CACHE_EXPIRATION_SECONDS = 60.0; // 1 minute
|
||||||
|
|
||||||
private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>();
|
private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>();
|
||||||
private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>();
|
private static ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<FolderType, InventoryFolderBase>>();
|
||||||
private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>();
|
private static ExpiringCache<UUID, InventoryCollection> m_Inventories = new ExpiringCache<UUID, InventoryCollection>();
|
||||||
|
|
||||||
|
|
||||||
|
public void RemoveAll(UUID userID)
|
||||||
|
{
|
||||||
|
if(m_RootFolders.Contains(userID))
|
||||||
|
m_RootFolders.Remove(userID);
|
||||||
|
if(m_FolderTypes.Contains(userID))
|
||||||
|
m_FolderTypes.Remove(userID);
|
||||||
|
if(m_Inventories.Contains(userID))
|
||||||
|
m_Inventories.Remove(userID);
|
||||||
|
}
|
||||||
|
|
||||||
public void Cache(UUID userID, InventoryFolderBase root)
|
public void Cache(UUID userID, InventoryFolderBase root)
|
||||||
{
|
{
|
||||||
m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS);
|
m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS);
|
||||||
|
|
Loading…
Reference in New Issue