Async purge so that the client thread doesn't wait.
parent
4818d11b9d
commit
4382f28efc
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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,9 +559,25 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <param name="remoteClient"></param>
|
||||
/// <param name="folderID"></param>
|
||||
|
||||
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);
|
||||
|
@ -568,5 +585,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID);
|
||||
}
|
||||
|
||||
private void PurgeFolderCompleted(IAsyncResult iar)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue