mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
Ref T295, 2nd connect check if one failed
Experimental: See if this finds false warnings
This commit is contained in:
@@ -134,8 +134,17 @@ namespace BlackCore
|
|||||||
const bool wasInternetAvailable = m_internetAccessible;
|
const bool wasInternetAvailable = m_internetAccessible;
|
||||||
const bool networkAccessible = this->isNetworkkAccessibleOrCheckDisabled();
|
const bool networkAccessible = this->isNetworkkAccessibleOrCheckDisabled();
|
||||||
const CUrl testUrl(CNetworkWatchdog::dbTestUrl());
|
const CUrl testUrl(CNetworkWatchdog::dbTestUrl());
|
||||||
bool canConnectDb = m_checkDbAccessibility && networkAccessible &&
|
bool canConnectDb = m_checkDbAccessibility && networkAccessible;
|
||||||
CNetworkUtils::canConnect(testUrl, CanConnectTimeMs); // running here in background worker
|
if (canConnectDb)
|
||||||
|
{
|
||||||
|
// running here in background worker check twice
|
||||||
|
canConnectDb = CNetworkUtils::canConnect(testUrl, CanConnectTimeMs);
|
||||||
|
if (!canConnectDb)
|
||||||
|
{
|
||||||
|
canConnectDb = CNetworkUtils::canConnect(testUrl, CanConnectTimeMs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_checkDbAccessibility && m_doDetailedCheck && canConnectDb)
|
if (m_checkDbAccessibility && m_doDetailedCheck && canConnectDb)
|
||||||
{
|
{
|
||||||
// test against real HTTP response
|
// test against real HTTP response
|
||||||
@@ -223,6 +232,7 @@ namespace BlackCore
|
|||||||
// avoid unnecessary signals
|
// avoid unnecessary signals
|
||||||
const int accessiblityInt = static_cast<int>(accessibility);
|
const int accessiblityInt = static_cast<int>(accessibility);
|
||||||
if (m_networkAccessibility == accessiblityInt) { return; }
|
if (m_networkAccessibility == accessiblityInt) { return; }
|
||||||
|
if (m_disableNetworkCheck) { return; } // ignore with disabled check
|
||||||
|
|
||||||
// shift to thread
|
// shift to thread
|
||||||
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
||||||
@@ -316,9 +326,13 @@ namespace BlackCore
|
|||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
|
// be a little less verbose
|
||||||
|
if ((m_totalGoodCountDb % 5 == 0) || m_consecutivePingBadCount > 0)
|
||||||
|
{
|
||||||
|
CLogMessage(this).info("Watchdog pinged '%1'") << url;
|
||||||
|
}
|
||||||
m_totalGoodCountDb++;
|
m_totalGoodCountDb++;
|
||||||
m_consecutivePingBadCount = 0;
|
m_consecutivePingBadCount = 0;
|
||||||
CLogMessage(this).info("Watchdog pinged '%1'") << url;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ namespace BlackCore
|
|||||||
std::atomic_bool m_online { true };
|
std::atomic_bool m_online { true };
|
||||||
std::atomic_bool m_internetAccessible { true };
|
std::atomic_bool m_internetAccessible { true };
|
||||||
std::atomic_bool m_dbAccessible { true };
|
std::atomic_bool m_dbAccessible { true };
|
||||||
std::atomic_bool m_lastClientPingSuccess { true };
|
std::atomic_bool m_lastClientPingSuccess { true }; //!< ping swift DB client service
|
||||||
std::atomic_bool m_checkDbAccessibility { true };
|
std::atomic_bool m_checkDbAccessibility { true };
|
||||||
std::atomic_bool m_checkSharedUrl { true };
|
std::atomic_bool m_checkSharedUrl { true };
|
||||||
std::atomic_bool m_checkInProgress { false }; //!< a check is currently in progress
|
std::atomic_bool m_checkInProgress { false }; //!< a check is currently in progress
|
||||||
|
|||||||
Reference in New Issue
Block a user