mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Do not trigger loads if they are doomed to fail
This commit is contained in:
@@ -45,16 +45,22 @@ namespace BlackCore
|
||||
QTimer::singleShot(0, &m_updateTimer, [this] { this->m_updateTimer.start(); }); // restart
|
||||
}
|
||||
|
||||
bool CNetworkWatchdog::hasWorkingSharedUrl() const
|
||||
{
|
||||
if (!m_networkAccessible) { return false; }
|
||||
return !this->getWorkingSharedUrl().isEmpty();
|
||||
}
|
||||
|
||||
CUrl CNetworkWatchdog::getWorkingSharedUrl() const
|
||||
{
|
||||
if (!m_networkAccessible) return CUrl();
|
||||
if (!m_networkAccessible) { return CUrl(); }
|
||||
QReadLocker l(&m_lockSharedUrl);
|
||||
return m_workingSharedUrl;
|
||||
}
|
||||
|
||||
int CNetworkWatchdog::triggerCheck()
|
||||
{
|
||||
if (!this->doWorkCheck()) return false; // senseless
|
||||
if (!this->doWorkCheck()) { return false; } // senseless
|
||||
if (m_checkInProgress) { return -1; }
|
||||
|
||||
const int n = this->getCheckCount();
|
||||
|
||||
@@ -62,6 +62,10 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
bool isInternetAccessible() const { return m_internetAccessible; }
|
||||
|
||||
//! Has working shared URL?
|
||||
//! \threadsafe
|
||||
bool hasWorkingSharedUrl() const;
|
||||
|
||||
//! A working shared URL
|
||||
//! \threadsafe
|
||||
BlackMisc::Network::CUrl getWorkingSharedUrl() const;
|
||||
|
||||
Reference in New Issue
Block a user