diff options
Diffstat (limited to 'indra/newview/llaisapi.cpp')
| -rw-r--r-- | indra/newview/llaisapi.cpp | 76 |
1 files changed, 50 insertions, 26 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index f67f2688a1..f0b7457fa2 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -1039,6 +1039,19 @@ AISUpdate::AISUpdate(const LLSD& update, AISAPI::COMMAND_TYPE type, const LLSD& mFetchDepth = request_body["depth"].asInteger(); } + // Some tasks are time sensitive, don't wait for them. + // Like FETCHCOF which happens on load and is needed for outfit + // loading. + // FETCHCATEGORYLINKS is used for wearing outfits and fetching + // a user selected outfit or for following an outfit link in COF. + // Other tasks, like FETCHCATEGORYSUBSET are general background + // fetches and can safely wait. + // Do count 'time sensitive' tasks in batch timer. + mUseTimeout = + type != AISAPI::UPDATECATEGORY + && type != AISAPI::UPDATEITEM + && type != AISAPI::FETCHCOF + && type != AISAPI::FETCHCATEGORYLINKS; mTaskTimer.setTimerExpirySec(AIS_TASK_EXPIRY_SECONDS); mTaskTimer.start(); @@ -1069,6 +1082,11 @@ void AISUpdate::clearParseResults() void AISUpdate::checkTimeout() { + if (!mUseTimeout) + { + // Priority task, don't wait. + return; + } if (mTaskTimer.hasExpired() || sBatchTimer.hasExpired()) { // If we are taking too long, don't starve other tasks, @@ -1758,35 +1776,41 @@ void AISUpdate::doUpdate() const LLUUID id = ucv_it->first; S32 version = static_cast<S32>(ucv_it->second); LLViewerInventoryCategory *cat = gInventory.getCategory(id); - LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL; - if (cat->getVersion() != version) + // Update can be rather large and take time to process. + // By the time update gets to the category, it could + // could have been removed by the user + if (cat) { - // the AIS version should be considered the true version. Adjust - // our local category model to reflect this version number. Otherwise - // it becomes possible to get stuck with the viewer being out of - // sync with the inventory system. Under normal circumstances - // inventory COF is maintained on the viewer through calls to - // LLInventoryModel::accountForUpdate when a changing operation - // is performed. This occasionally gets out of sync however. - if (version != LLViewerInventoryCategory::VERSION_UNKNOWN) - { - LL_WARNS() << "Possible version mismatch for category " << cat->getName() - << ", viewer version " << cat->getVersion() - << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL; - cat->setVersion(version); - } - else + LL_DEBUGS("Inventory") << "cat " << cat->getName() << " version update from " << cat->getVersion() << " to AIS version " << version << LL_ENDL; + if (cat->getVersion() != version) { - // We do not account for update if version is UNKNOWN, so we shouldn't rise version - // either or viewer will get stuck on descendants count -1, try to refetch folder instead - // - // Todo: proper backoff? + // the AIS version should be considered the true version. Adjust + // our local category model to reflect this version number. Otherwise + // it becomes possible to get stuck with the viewer being out of + // sync with the inventory system. Under normal circumstances + // inventory COF is maintained on the viewer through calls to + // LLInventoryModel::accountForUpdate when a changing operation + // is performed. This occasionally gets out of sync however. + if (version != LLViewerInventoryCategory::VERSION_UNKNOWN) + { + LL_WARNS() << "Possible version mismatch for category " << cat->getName() + << ", viewer version " << cat->getVersion() + << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL; + cat->setVersion(version); + } + else + { + // We do not account for update if version is UNKNOWN, so we shouldn't riase version + // either or viewer will get stuck on descendants count -1, try to refetch folder instead + // + // Todo: proper backoff? - LL_WARNS() << "Possible version mismatch for category " << cat->getName() - << ", viewer version " << cat->getVersion() - << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL; - const S32 LONG_EXPIRY = 360; - cat->fetch(LONG_EXPIRY); + LL_WARNS() << "Possible version mismatch for category " << cat->getName() + << ", viewer version " << cat->getVersion() + << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL; + const S32 LONG_EXPIRY = 360; + cat->fetch(LONG_EXPIRY); + } } } } |
