DB watchdog also emits URL in signal (allows to display the failed URL)

This commit is contained in:
Klaus Basan
2018-04-02 02:21:53 +02:00
parent 0b4637054a
commit b6b37c9c0f
6 changed files with 27 additions and 15 deletions

View File

@@ -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());

View File

@@ -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);