From 4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 19 Aug 2009 00:33:02 -0700 Subject: Async purge so that the client thread doesn't wait. --- .../Inventory/RemoteInventoryServiceConnector.cs | 10 ++++----- .../Framework/Scenes/Scene.PacketHandlers.cs | 24 ++++++++++++++++++++-- 2 files changed, 27 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 012f0e3..081d0f7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -323,14 +323,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private UUID GetSessionID(UUID userID) { - if (m_Scene == null) - { - m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); - } + //if (m_Scene == null) + //{ + // m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); + //} if (m_UserProfileService == null) { - m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); + //m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); return UUID.Zero; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index a2414e5..77b980c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using System.Threading; using OpenMetaverse; @@ -558,15 +559,34 @@ namespace OpenSim.Region.Framework.Scenes /// /// + delegate void PurgeFolderDelegate(UUID userID, UUID folder); + public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) { - InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); + PurgeFolderDelegate d = PurgeFolderAsync; + try + { + d.BeginInvoke(remoteClient.AgentId, folderID, PurgeFolderCompleted, d); + } + catch (Exception e) + { + m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message); + } + } + + + private void PurgeFolderAsync(UUID userID, UUID folderID) + { + InventoryFolderBase folder = new InventoryFolderBase(folderID, userID); if (InventoryService.PurgeFolder(folder)) m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); else m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID); - } + } + private void PurgeFolderCompleted(IAsyncResult iar) + { + } } } -- cgit v1.1