summaryrefslogtreecommitdiff
path: root/indra/newview/llaisapi.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-04-28 19:34:26 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-04-28 19:34:26 +0300
commit4bfcf182d7a961d8ebfe17b453e54cfac26347ce (patch)
tree2c03620480d8358d56a4a26673d58006afe4aa4b /indra/newview/llaisapi.cpp
parent9349a9b5d4ccb21f195e5c156d897836399fd11b (diff)
SL-19533 Fetch stall prevention #2
Diffstat (limited to 'indra/newview/llaisapi.cpp')
-rw-r--r--indra/newview/llaisapi.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index e63d77cea3..951860e39d 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -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