summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodelbackgroundfetch.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-08-18 13:57:14 +0800
committerErik Kundiman <erik@megapahit.org>2026-08-18 13:57:14 +0800
commit2fa8281b2d8ce8bdbcacf139ec674480da6c9d81 (patch)
treeffb343fee97f21942123fd322d88fea3ef1a4811 /indra/newview/llinventorymodelbackgroundfetch.cpp
parent742d802f073e81abc6d4cd512e58a4d03b414b83 (diff)
parent214fa765986b4c1e1de1b917581f8508278abd8e (diff)
Merge branch '26.3'
Diffstat (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp')
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.cpp35
1 files changed, 28 insertions, 7 deletions
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index 82eefb50ac..b02b2e2eb9 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -192,6 +192,8 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch():
mFetchCount(0),
mLastFetchCount(0),
mFetchFolderCount(0),
+ mInitialFetchDuration(0.f),
+ mInitialFetchDurationCaptured(false),
mAllRecursiveFoldersFetched(false),
mRecursiveInventoryFetchStarted(false),
mRecursiveLibraryFetchStarted(false),
@@ -199,6 +201,15 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch():
mMinTimeBetweenFetches(0.3f)
{}
+void LLInventoryModelBackgroundFetch::markFetchStarted()
+{
+ if (!mBackgroundFetchActive)
+ {
+ mFetchStartTimer.reset();
+ }
+ mBackgroundFetchActive = true;
+}
+
LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch()
{
gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr);
@@ -289,7 +300,7 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, bool recursive)
// it's a folder, do a bulk fetch
LL_DEBUGS(LOG_INV) << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL;
- mBackgroundFetchActive = true;
+ markFetchStarted();
mFolderFetchActive = true;
EFetchType recursion_type = recursive ? FT_RECURSIVE : FT_DEFAULT;
if (id.isNull())
@@ -376,7 +387,7 @@ void LLInventoryModelBackgroundFetch::scheduleFolderFetch(const LLUUID& cat_id,
{
if (mFetchFolderQueue.empty() || mFetchFolderQueue.front().mUUID != cat_id)
{
- mBackgroundFetchActive = true;
+ markFetchStarted();
mFolderFetchActive = true;
if (forced)
@@ -403,7 +414,7 @@ void LLInventoryModelBackgroundFetch::scheduleItemFetch(const LLUUID& item_id, b
{
if (mFetchItemQueue.empty() || mFetchItemQueue.front().mUUID != item_id)
{
- mBackgroundFetchActive = true;
+ markFetchStarted();
if (forced)
{
// check if already requested
@@ -447,7 +458,7 @@ void LLInventoryModelBackgroundFetch::fetchFolderAndLinks(const LLUUID& cat_id,
});
// start idle loop to track completion
- mBackgroundFetchActive = true;
+ markFetchStarted();
mFolderFetchActive = true;
gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr);
}
@@ -489,14 +500,14 @@ void LLInventoryModelBackgroundFetch::fetchCOF(nullary_func_t callback)
});
// start idle loop to track completion
- mBackgroundFetchActive = true;
+ markFetchStarted();
mFolderFetchActive = true;
gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr);
}
void LLInventoryModelBackgroundFetch::findLostItems()
{
- mBackgroundFetchActive = true;
+ markFetchStarted();
mFolderFetchActive = true;
mFetchFolderQueue.emplace_back(LLUUID::null, FT_RECURSIVE);
gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr);
@@ -515,13 +526,18 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched()
mFolderFetchActive = false;
if (isBulkFetchProcessingComplete())
{
+ if (mAllRecursiveFoldersFetched && !mInitialFetchDurationCaptured)
+ {
+ mInitialFetchDuration = mFetchStartTimer.getElapsedTimeF32();
+ mInitialFetchDurationCaptured = true;
+ }
mBackgroundFetchActive = false;
}
// For now only informs about initial fetch being done
mFoldersFetchedSignal();
- LL_INFOS(LOG_INV) << "Inventory background fetch completed" << LL_ENDL;
+ LL_INFOS(LOG_INV) << "Inventory background fetch completed after: " << mFetchStartTimer.getElapsedTimeF32() << LL_ENDL;
}
boost::signals2::connection LLInventoryModelBackgroundFetch::setFetchCompletionCallback(folders_fetched_callback_t cb)
@@ -843,6 +859,11 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
if (isBulkFetchProcessingComplete())
{
+ if (mAllRecursiveFoldersFetched && !mInitialFetchDurationCaptured)
+ {
+ mInitialFetchDuration = mFetchStartTimer.getElapsedTimeF32();
+ mInitialFetchDurationCaptured = true;
+ }
mBackgroundFetchActive = false;
}
}