From e755727a0ff4af37f5cbd074800a15144707b4a7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sun, 20 Apr 2008 18:45:03 +0000 Subject: * Change lazy user inventory creation on first login to synchronous rather than async. * Add more error checking so that we don't proceed if there has been a problem with inventory retrieval --- OpenSim/Grid/UserServer/UserLoginService.cs | 35 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'OpenSim/Grid/UserServer') diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index a3bc9f0..e71a2cc 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -303,9 +303,8 @@ namespace OpenSim.Grid.UserServer protected override InventoryData GetInventorySkeleton(LLUUID userID) { m_log.DebugFormat( - "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of agent {1}", - m_config.InventoryUrl, userID); - + "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", + m_config.InventoryUrl, userID); List folders = SynchronousRestObjectPoster.BeginPostObject>( @@ -316,22 +315,27 @@ namespace OpenSim.Grid.UserServer // which does. if (null == folders || folders.Count == 0) { - m_log.Warn( - "[LOGIN]: " + - "root inventory folder user " + userID + " not found. Creating."); - - RestObjectPoster.BeginPostObject( - m_config.InventoryUrl + "CreateInventory/", userID.UUID); + m_log.InfoFormat( + "[LOGIN]: A root inventory folder for user {0} was not found. Requesting creation.", userID); - // A big delay should be okay here since the recreation of the user's root folders should - // only ever happen once. We need to sleep to let the inventory server do its work - - // previously 1000ms has been found to be too short. - Thread.Sleep(10000); + bool created = + SynchronousRestObjectPoster.BeginPostObject( + "POST", m_config.InventoryUrl + "CreateInventory/", userID.UUID); + + if (!created) + { + throw new Exception( + String.Format( + "The inventory creation request for user {0} did not succeed." + + " Please contact your inventory service provider for more information.", + userID)); + } + folders = SynchronousRestObjectPoster.BeginPostObject>( "POST", m_config.InventoryUrl + "RootFolders/", userID.UUID); } - if (folders.Count > 0) + if (folders != null && folders.Count > 0) { LLUUID rootID = LLUUID.Zero; ArrayList AgentInventoryArray = new ArrayList(); @@ -358,7 +362,8 @@ namespace OpenSim.Grid.UserServer { throw new Exception( String.Format( - "A root inventory folder for {0} could not be retrieved from the inventory service", userID)); + "A root inventory folder for user {0} could not be retrieved from the inventory service", + userID)); } } } -- cgit v1.1