diff options
author | Justin Clarke Casey | 2008-04-13 22:09:07 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-13 22:09:07 +0000 |
commit | 451a5bbf30bf0ff02c7318b7b6f9f708309165ac (patch) | |
tree | 0afa65e26108615a637d58f9e9cbad3ec5307b0a /OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |
parent | Update svn properties. (diff) | |
download | opensim-SC-451a5bbf30bf0ff02c7318b7b6f9f708309165ac.zip opensim-SC-451a5bbf30bf0ff02c7318b7b6f9f708309165ac.tar.gz opensim-SC-451a5bbf30bf0ff02c7318b7b6f9f708309165ac.tar.bz2 opensim-SC-451a5bbf30bf0ff02c7318b7b6f9f708309165ac.tar.xz |
* Put in crude poll waiting for 60 seconds for delayed user inventory delivery from the inventory service
* This will reduce failures where the inventory server is simply slow
* Still need to properly inform the user if the inventory service has failed altogether
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 6b09e01..7995841 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | |||
@@ -355,11 +355,36 @@ namespace OpenSim.Framework.Communications.Cache | |||
355 | if ((fold = libraryRoot.HasSubFolder(folderID)) != null) | 355 | if ((fold = libraryRoot.HasSubFolder(folderID)) != null) |
356 | { | 356 | { |
357 | return fold.RequestListOfItems(); | 357 | return fold.RequestListOfItems(); |
358 | } | 358 | } |
359 | 359 | ||
360 | CachedUserInfo userProfile; | 360 | CachedUserInfo userProfile; |
361 | if (m_userProfiles.TryGetValue(agentID, out userProfile)) | 361 | if (m_userProfiles.TryGetValue(agentID, out userProfile)) |
362 | { | 362 | { |
363 | // XXX: When a client crosses into a scene, their entire inventory is fetched | ||
364 | // asynchronously. If the client makes a request before the inventory is received, we need | ||
365 | // to give the inventory a chance to come in. | ||
366 | // | ||
367 | // This is a crude way of dealing with that by retrying the lookup. It's not quite as bad | ||
368 | // in CAPS as doing this with the udp request, since here it won't hold up other packets. | ||
369 | // In fact, here we'll be generous and try for longer. | ||
370 | if (!userProfile.HasInventory) | ||
371 | { | ||
372 | int attempts = 0; | ||
373 | while (attempts++ < 20) | ||
374 | { | ||
375 | m_log.DebugFormat( | ||
376 | "[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}", | ||
377 | attempts, folderID, agentID); | ||
378 | |||
379 | Thread.Sleep(3000); | ||
380 | |||
381 | if (userProfile.HasInventory) | ||
382 | { | ||
383 | break; | ||
384 | } | ||
385 | } | ||
386 | } | ||
387 | |||
363 | if (userProfile.HasInventory) | 388 | if (userProfile.HasInventory) |
364 | { | 389 | { |
365 | if (userProfile.RootFolder.ID == folderID) | 390 | if (userProfile.RootFolder.ID == folderID) |