summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-12-02 00:44:56 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-12-02 15:44:32 +0200
commit7991ae892ef0f717636c0fe3c0eff0a5f92e6bb8 (patch)
tree982bcc1ced0ed78185c6d5115119c4e30eea1818 /indra/newview/llappviewer.cpp
parentc62735adc8fa5a31f6c306c6919c7e32e956976d (diff)
#5084 Ressurect Watchdog
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 72bfdcf83c..f6f5f1717b 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3145,7 +3145,7 @@ bool LLAppViewer::initWindow()
// Need to load feature table before cheking to start watchdog.
bool use_watchdog = false;
- int watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled");
+ S32 watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled");
if (watchdog_enabled_setting == -1)
{
use_watchdog = !LLFeatureManager::getInstance()->isFeatureAvailable("WatchdogDisabled");
@@ -5820,12 +5820,12 @@ void LLAppViewer::forceExceptionThreadCrash()
thread->start();
}
-void LLAppViewer::initMainloopTimeout(std::string_view state, F32 secs)
+void LLAppViewer::initMainloopTimeout(std::string_view state)
{
if (!mMainloopTimeout)
{
mMainloopTimeout = new LLWatchdogTimeout();
- resumeMainloopTimeout(state, secs);
+ resumeMainloopTimeout(state);
}
}
@@ -5838,17 +5838,11 @@ void LLAppViewer::destroyMainloopTimeout()
}
}
-void LLAppViewer::resumeMainloopTimeout(std::string_view state, F32 secs)
+void LLAppViewer::resumeMainloopTimeout(std::string_view state)
{
if (mMainloopTimeout)
{
- if (secs < 0.0f)
- {
- static LLCachedControl<F32> mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60.f);
- secs = mainloop_timeout;
- }
-
- mMainloopTimeout->setTimeout(secs);
+ mMainloopTimeout->setTimeout(getMainloopTimeoutSec());
mMainloopTimeout->start(state);
}
}
@@ -5861,23 +5855,33 @@ void LLAppViewer::pauseMainloopTimeout()
}
}
-void LLAppViewer::pingMainloopTimeout(std::string_view state, F32 secs)
+void LLAppViewer::pingMainloopTimeout(std::string_view state)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_APP;
if (mMainloopTimeout)
{
- if (secs < 0.0f)
- {
- static LLCachedControl<F32> mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60);
- secs = mainloop_timeout;
- }
-
- mMainloopTimeout->setTimeout(secs);
+ mMainloopTimeout->setTimeout(getMainloopTimeoutSec());
mMainloopTimeout->ping(state);
}
}
+
+F32 LLAppViewer::getMainloopTimeoutSec() const
+{
+ if (LLStartUp::getStartupState() == STATE_STARTED
+ && gAgent.getTeleportState() == LLAgent::TELEPORT_NONE)
+ {
+ static LLCachedControl<F32> mainloop_started(gSavedSettings, "MainloopTimeoutStarted", 30.f);
+ return mainloop_started();
+ }
+ else
+ {
+ static LLCachedControl<F32> mainloop_default(gSavedSettings, "MainloopTimeoutDefault", 120.f);
+ return mainloop_default();
+ }
+}
+
void LLAppViewer::handleLoginComplete()
{
gLoggedInTime.start();