Skip to content
Snippets Groups Projects
Commit 222a8b10 authored by andreykproductengine's avatar andreykproductengine
Browse files

MAINT-5174 Add Check for Updates feature to Help menu

parent 35b47d20
No related branches found
No related tags found
No related merge requests found
...@@ -269,12 +269,40 @@ void LLUpdaterServiceImpl::stopChecking() ...@@ -269,12 +269,40 @@ void LLUpdaterServiceImpl::stopChecking()
bool LLUpdaterServiceImpl::forceCheck() bool LLUpdaterServiceImpl::forceCheck()
{ {
if (mTimer.getStarted() if (!mIsDownloading && getState() != LLUpdaterService::CHECKING_FOR_UPDATE)
&& !mIsDownloading)
{ {
mTimer.setTimerExpirySec(0); if (mIsChecking)
setState(LLUpdaterService::CHECKING_FOR_UPDATE); {
return true; // Service is running, just reset the timer
if (mTimer.getStarted())
{
mTimer.setTimerExpirySec(0);
setState(LLUpdaterService::CHECKING_FOR_UPDATE);
return true;
}
}
else if (!mChannel.empty() && !mVersion.empty())
{
// one time check
bool has_install = checkForInstall(false);
if (!has_install)
{
std::string query_url = LLGridManager::getInstance()->getUpdateServiceURL();
if (!query_url.empty())
{
setState(LLUpdaterService::CHECKING_FOR_UPDATE);
mUpdateChecker.checkVersion(query_url, mChannel, mVersion,
mPlatform, mPlatformVersion, mUniqueId,
mWillingToTest);
return true;
}
else
{
LL_WARNS("UpdaterService")
<< "No updater service defined for grid '" << LLGridManager::getInstance()->getGrid() << LL_ENDL;
}
}
}
} }
return false; return false;
} }
...@@ -415,9 +443,9 @@ bool LLUpdaterServiceImpl::checkForResume() ...@@ -415,9 +443,9 @@ bool LLUpdaterServiceImpl::checkForResume()
void LLUpdaterServiceImpl::error(std::string const & message) void LLUpdaterServiceImpl::error(std::string const & message)
{ {
setState(LLUpdaterService::TEMPORARY_ERROR);
if(mIsChecking) if(mIsChecking)
{ {
setState(LLUpdaterService::TEMPORARY_ERROR);
restartTimer(mCheckPeriod); restartTimer(mCheckPeriod);
} }
} }
...@@ -462,8 +490,12 @@ void LLUpdaterServiceImpl::response(LLSD const & content) ...@@ -462,8 +490,12 @@ void LLUpdaterServiceImpl::response(LLSD const & content)
else else
{ {
LL_WARNS("UpdaterService") << "Invalid update query response ignored; retry in " LL_WARNS("UpdaterService") << "Invalid update query response ignored; retry in "
<< mCheckPeriod << " seconds" << LL_ENDL; << mCheckPeriod << " seconds" << LL_ENDL;
restartTimer(mCheckPeriod); setState(LLUpdaterService::TEMPORARY_ERROR);
if (mIsChecking)
{
restartTimer(mCheckPeriod);
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment