summaryrefslogtreecommitdiff
path: root/indra/newview/llaisapi.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-05-21 19:37:15 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2026-05-21 19:37:15 +0300
commit15d82beb6056fa16a1ea1cbf01c5d673a95e0267 (patch)
tree55af7639161926313434d9e4a8b9872369668d5d /indra/newview/llaisapi.cpp
parentff536adef0b74c20f55bd501ad593e4eef762082 (diff)
parent6d4c4c029ce43aa413266135829cd2bc00001890 (diff)
Merge branch 'main' into marchcat/slua-26.2
# Conflicts: # indra/llfilesystem/lldir.cpp # indra/llfilesystem/llfilesystem.cpp # indra/newview/llappviewer.cpp # indra/newview/lltexturecache.cpp # indra/newview/llvoiceclient.cpp # indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
Diffstat (limited to 'indra/newview/llaisapi.cpp')
-rw-r--r--indra/newview/llaisapi.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 9c76f56ef3..f67f2688a1 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -1019,6 +1019,9 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
}
//-------------------------------------------------------------------------
+U32 AISUpdate::sBatchFrameCount = 0;
+LLTimer AISUpdate::sBatchTimer;
+
AISUpdate::AISUpdate(const LLSD& update, AISAPI::COMMAND_TYPE type, const LLSD& request_body)
: mType(type)
{
@@ -1036,8 +1039,16 @@ AISUpdate::AISUpdate(const LLSD& update, AISAPI::COMMAND_TYPE type, const LLSD&
mFetchDepth = request_body["depth"].asInteger();
}
- mTimer.setTimerExpirySec(AIS_EXPIRY_SECONDS);
- mTimer.start();
+ mTaskTimer.setTimerExpirySec(AIS_TASK_EXPIRY_SECONDS);
+ mTaskTimer.start();
+
+ U32 current_frame = LLFrameTimer::getFrameCount();
+ if (sBatchFrameCount != current_frame)
+ {
+ sBatchTimer.setTimerExpirySec(AIS_BATCH_EXPIRY_SECONDS);
+ sBatchTimer.start();
+ sBatchFrameCount = current_frame;
+ }
parseUpdate(update);
}
@@ -1058,7 +1069,7 @@ void AISUpdate::clearParseResults()
void AISUpdate::checkTimeout()
{
- if (mTimer.hasExpired())
+ if (mTaskTimer.hasExpired() || sBatchTimer.hasExpired())
{
// If we are taking too long, don't starve other tasks,
// yield to mainloop.
@@ -1067,7 +1078,16 @@ void AISUpdate::checkTimeout()
// a chance, so wait for a frame tick instead.
llcoro::suspendUntilNextFrame();
LLCoros::checkStop();
- mTimer.setTimerExpirySec(AIS_EXPIRY_SECONDS);
+ mTaskTimer.setTimerExpirySec(AIS_TASK_EXPIRY_SECONDS);
+
+ U32 current_frame = LLFrameTimer::getFrameCount();
+ if (sBatchFrameCount != current_frame)
+ {
+ // To give other tasks a chance batch timer
+ // has a longer delay.
+ sBatchTimer.setTimerExpirySec(AIS_BATCH_EXPIRY_SECONDS);
+ sBatchFrameCount = current_frame;
+ }
}
}