mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
DB watchdog also emits URL in signal (allows to display the failed URL)
This commit is contained in:
@@ -1064,15 +1064,15 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
void CApplication::onChangedSwiftDbAccessibility(bool accessible)
|
||||
void CApplication::onChangedSwiftDbAccessibility(bool accessible, const CUrl &url)
|
||||
{
|
||||
if (accessible)
|
||||
{
|
||||
CLogMessage(this).info("swift DB reported accessible");
|
||||
CLogMessage(this).info("swift DB reported accessible: '%1'") << url.toQString();
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).warning("swift DB not accessible");
|
||||
CLogMessage(this).warning("swift DB not accessible: '%1'") << url.toQString();
|
||||
if (m_networkWatchDog)
|
||||
{
|
||||
CLogMessage(this).warning(m_networkWatchDog->getCheckInfo());
|
||||
|
||||
@@ -492,7 +492,7 @@ namespace BlackCore
|
||||
void changedInternetAccessibility(bool accessible);
|
||||
|
||||
//! DB accessibility changed
|
||||
void changedSwiftDbAccessibility(bool accessible);
|
||||
void changedSwiftDbAccessibility(bool accessible, const BlackMisc::Network::CUrl &testedUrl);
|
||||
|
||||
protected:
|
||||
//! Setup read/synchronized
|
||||
@@ -575,7 +575,7 @@ namespace BlackCore
|
||||
void onChangedInternetAccessibility(bool accessible);
|
||||
|
||||
//! Changed swift DB accessibility
|
||||
void onChangedSwiftDbAccessibility(bool accessible);
|
||||
void onChangedSwiftDbAccessibility(bool accessible, const BlackMisc::Network::CUrl &url);
|
||||
|
||||
//! init logging system
|
||||
void initLogging();
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace BlackCore
|
||||
|
||||
QString CNetworkWatchdog::getCheckInfo() const
|
||||
{
|
||||
static const QString info("Internet accessible: %1 (good: %2/ bad: %3), swift DB accessible: %4 (good: %5/bad: %6)");
|
||||
static const QString info("Internet accessible: %1 (good: %2 / bad: %3), swift DB accessible: %4 (good: %5 / bad: %6)");
|
||||
return info.
|
||||
arg(boolToYesNo(this->isInternetAccessible())).arg(m_goodCountInternet).arg(m_badCountInternet).
|
||||
arg(boolToYesNo(this->isSwiftDbAccessible())).arg(m_goodCountDb).arg(m_badCountDb);
|
||||
@@ -247,11 +247,12 @@ namespace BlackCore
|
||||
// trigger really queued
|
||||
if (oldDbAccessible != m_dbAccessible)
|
||||
{
|
||||
QTimer::singleShot(0, this, [this] { emit this->changedSwiftDbAccessibility(m_dbAccessible);});
|
||||
const CUrl testUrl(this->dbTestUrl());
|
||||
QTimer::singleShot(0, this, [=] { emit this->changedSwiftDbAccessibility(m_dbAccessible, testUrl); });
|
||||
}
|
||||
if (oldInternetAccessible != m_internetAccessible)
|
||||
{
|
||||
QTimer::singleShot(0, this, [this] { emit this->changedInternetAccessibility(m_internetAccessible);});
|
||||
QTimer::singleShot(0, this, [this] { emit this->changedInternetAccessibility(m_internetAccessible); });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +262,7 @@ namespace BlackCore
|
||||
this->setWorkingSharedUrl(workingUrl);
|
||||
}
|
||||
|
||||
BlackMisc::Network::CUrl CNetworkWatchdog::dbTestUrl()
|
||||
CUrl CNetworkWatchdog::dbTestUrl()
|
||||
{
|
||||
// requires global setup to be read
|
||||
const CUrl testUrl(sApp->getGlobalSetup().getDbHomePageUrl());
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace BlackCore
|
||||
|
||||
signals:
|
||||
//! DB was available, but not longer is and vice versa
|
||||
void changedSwiftDbAccessibility(bool available);
|
||||
void changedSwiftDbAccessibility(bool available, const BlackMisc::Network::CUrl &url);
|
||||
|
||||
//! Internet was available, but not longer is and vice versa
|
||||
void changedInternetAccessibility(bool available);
|
||||
|
||||
Reference in New Issue
Block a user