mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
DB watchdog also emits URL in signal (allows to display the failed URL)
This commit is contained in:
@@ -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