From 96f0c6f074301484b44ce29c1a92ce13766f9883 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 5 Jun 2015 10:07:50 -0700 Subject: [PATCH] More on mantis #7567. Two things: - Increase the inventory cache timeout to 20 secs, so that the items will still be there when they are needed by the sim for rezzing - Before rezzing attachs, make a call to GetMultipleItems so to fetch them all at the same time --- .../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 8 ++++++++ .../Connectors/Inventory/XInventoryServicesConnector.cs | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 77abcd7091..59c2179aba 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -304,6 +304,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing any attachments for {0} from simulator-side", sp.Name); List attachments = sp.Appearance.GetAttachments(); + + // Let's get all items at once, so they get cached + UUID[] items = new UUID[attachments.Count]; + int i = 0; + foreach (AvatarAttachment attach in attachments) + items[i++] = attach.ItemID; + m_scene.InventoryService.GetMultipleItems(sp.UUID, items); + foreach (AvatarAttachment attach in attachments) { uint attachmentPt = (uint)attach.AttachPoint; diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index a68ec5a0b5..597d92b3e3 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs @@ -62,7 +62,7 @@ namespace OpenSim.Services.Connectors /// private int m_requestTimeoutSecs = -1; - private const double CACHE_EXPIRATION_SECONDS = 8.0; + private const double CACHE_EXPIRATION_SECONDS = 20.0; private static ExpiringCache m_ItemCache = new ExpiringCache(); public XInventoryServicesConnector() @@ -244,7 +244,7 @@ namespace OpenSim.Services.Connectors public virtual InventoryCollection[] GetMultipleFoldersContent(UUID principalID, UUID[] folderIDs) { InventoryCollection[] inventoryArr = new InventoryCollection[folderIDs.Length]; - //m_log.DebugFormat("[XXX]: In GetMultipleFoldersContent {0}", folderIDs.Length); + // m_log.DebugFormat("[XXX]: In GetMultipleFoldersContent {0}", String.Join(",", folderIDs)); try { Dictionary resultSet = MakeRequest("GETMULTIPLEFOLDERSCONTENT", @@ -544,6 +544,8 @@ namespace OpenSim.Services.Connectors public virtual InventoryItemBase[] GetMultipleItems(UUID principalID, UUID[] itemIDs) { + //m_log.DebugFormat("[XXX]: In GetMultipleItems {0}", String.Join(",", itemIDs)); + InventoryItemBase[] itemArr = new InventoryItemBase[itemIDs.Length]; // Try to get them from the cache List pending = new List();