diff options
Diffstat (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp')
-rw-r--r-- | indra/newview/llinventorymodelbackgroundfetch.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 277ddb16ba..c5fb40409f 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -555,6 +555,8 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis() } static LLCachedControl<U32> ais_pool(gSavedSettings, "PoolSizeAIS", 20); + // Don't have too many requests at once + // Reserve one request for actions outside of fetch (like renames) const U32 max_concurrent_fetches = llmax(1, ais_pool - 1); if (mFetchCount >= max_concurrent_fetches) @@ -562,6 +564,9 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis() return; } + // Don't fire all requests at once + const U32 max_requests_this_run = llmin(mFetchCount + 5, max_concurrent_fetches); + // Don't loop for too long (in case of large, fully loaded inventory) F64 curent_time = LLTimer::getTotalSeconds(); const F64 max_time = LLStartUp::getStartupState() > STATE_WEARABLES_WAIT @@ -570,7 +575,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis() const F64 end_time = curent_time + max_time; S32 last_fetch_count = mFetchCount; - while (!mFetchFolderQueue.empty() && mFetchCount < max_concurrent_fetches && curent_time < end_time) + while (!mFetchFolderQueue.empty() && mFetchCount < max_requests_this_run && curent_time < end_time) { const FetchQueueInfo & fetch_info(mFetchFolderQueue.front()); bulkFetchViaAis(fetch_info); @@ -581,7 +586,7 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis() // Ideally we shouldn't fetch items if recursive fetch isn't done, // but there is a chance some request will start timeouting and recursive // fetch will get stuck on a signle folder, don't block item fetch in such case - while (!mFetchItemQueue.empty() && mFetchCount < max_concurrent_fetches && curent_time < end_time) + while (!mFetchItemQueue.empty() && mFetchCount < max_requests_this_run && curent_time < end_time) { const FetchQueueInfo& fetch_info(mFetchItemQueue.front()); bulkFetchViaAis(fetch_info); |