SL-19533 Fetch stall prevention #2

meow-7.2.2
Andrey Kleshchev 2023-04-28 19:34:26 +03:00
parent 9349a9b5d4
commit 4bfcf182d7
2 changed files with 16 additions and 1 deletions

View File

@ -1550,6 +1550,7 @@ void AISUpdate::doUpdate()
}
// CREATE CATEGORIES
const S32 MAX_UPDATE_BACKLOG = 50; // stall prevention
for (deferred_category_map_t::const_iterator create_it = mCategoriesCreated.begin();
create_it != mCategoriesCreated.end(); ++create_it)
{
@ -1558,6 +1559,13 @@ void AISUpdate::doUpdate()
gInventory.updateCategory(new_category, LLInventoryObserver::CREATE);
LL_DEBUGS("Inventory") << "created category " << category_id << LL_ENDL;
// fetching can receive massive amount of items and fodlers
if (gInventory.getChangedIDs().size() > MAX_UPDATE_BACKLOG)
{
gInventory.notifyObservers();
checkTimeout();
}
}
// UPDATE CATEGORIES
@ -1612,6 +1620,13 @@ void AISUpdate::doUpdate()
// case this is create.
LL_DEBUGS("Inventory") << "created item " << item_id << LL_ENDL;
gInventory.updateItem(new_item, LLInventoryObserver::CREATE);
// fetching can receive massive amount of items and fodlers
if (gInventory.getChangedIDs().size() > MAX_UPDATE_BACKLOG)
{
gInventory.notifyObservers();
checkTimeout();
}
}
// UPDATE ITEMS

View File

@ -130,7 +130,7 @@ private:
// Debug is very log-heavy, give it more time or it will take forever to process
// Todo: find a way to make throttle static isntead of per-request
const F32 EXPIRY_SECONDS_DEBUG = 1.f;
const F32 EXPIRY_SECONDS_LIVE = 0.01f;
const F32 EXPIRY_SECONDS_LIVE = 0.008f;
typedef std::map<LLUUID,S32> uuid_int_map_t;
uuid_int_map_t mCatDescendentDeltas;