Skip to content

Commit 34ee998

Browse files
committed
#5892 Process high priority inventory updates immediately
1 parent 5543a2a commit 34ee998

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

indra/newview/llaisapi.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,19 @@ AISUpdate::AISUpdate(const LLSD& update, AISAPI::COMMAND_TYPE type, const LLSD&
10391039
mFetchDepth = request_body["depth"].asInteger();
10401040
}
10411041

1042+
// Some tasks are time sensitive, don't wait for them.
1043+
// Like FETCHCOF which happens on load and is needed for outfit
1044+
// loading.
1045+
// FETCHCATEGORYLINKS is used for wearing outfits and fetching
1046+
// a user selected outfit or for following an outfit link in COF.
1047+
// Other tasks, like FETCHCATEGORYSUBSET are general background
1048+
// fetches and can safely wait.
1049+
// Do count 'time sensitive' tasks in batch timer.
1050+
mUseTimeout =
1051+
type != AISAPI::UPDATECATEGORY
1052+
&& type != AISAPI::UPDATEITEM
1053+
&& type != AISAPI::FETCHCOF
1054+
&& type != AISAPI::FETCHCATEGORYLINKS;
10421055
mTaskTimer.setTimerExpirySec(AIS_TASK_EXPIRY_SECONDS);
10431056
mTaskTimer.start();
10441057

@@ -1069,6 +1082,11 @@ void AISUpdate::clearParseResults()
10691082

10701083
void AISUpdate::checkTimeout()
10711084
{
1085+
if (!mUseTimeout)
1086+
{
1087+
// Priority task, don't wait.
1088+
return;
1089+
}
10721090
if (mTaskTimer.hasExpired() || sBatchTimer.hasExpired())
10731091
{
10741092
// If we are taking too long, don't starve other tasks,

indra/newview/llaisapi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class AISAPI
109109

110110
class AISUpdate
111111
{
112+
LOG_CLASS(AISUpdate);
112113
public:
113114
AISUpdate(const LLSD& update, AISAPI::COMMAND_TYPE type, const LLSD& request_body);
114115
void parseUpdate(const LLSD& update);
@@ -158,6 +159,7 @@ class AISUpdate
158159
uuid_list_t mCategoryIds;
159160
bool mFetch;
160161
S32 mFetchDepth;
162+
bool mUseTimeout;
161163
LLTimer mTaskTimer;
162164
static LLTimer sBatchTimer;
163165
static U32 sBatchFrameCount;

0 commit comments

Comments
 (0)