mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 20:40:29 +08:00
refactor: Remove non-watchdog related method from WatchDog
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
#include "blackcore/db/databasereader.h"
|
#include "blackcore/db/databasereader.h"
|
||||||
#include "blackcore/db/infodatareader.h"
|
#include "blackcore/db/infodatareader.h"
|
||||||
#include "blackcore/db/databaseutils.h"
|
#include "blackcore/db/databaseutils.h"
|
||||||
#include "blackcore/db/networkwatchdog.h"
|
|
||||||
#include "blackcore/webdataservices.h"
|
#include "blackcore/webdataservices.h"
|
||||||
#include "blackcore/application.h"
|
#include "blackcore/application.h"
|
||||||
#include "blackmisc/db/datastoreutility.h"
|
#include "blackmisc/db/datastoreutility.h"
|
||||||
@@ -794,7 +793,7 @@ namespace BlackCore::Db
|
|||||||
|
|
||||||
bool CDatabaseReader::JsonDatastoreResponse::isLoadedFromDb() const
|
bool CDatabaseReader::JsonDatastoreResponse::isLoadedFromDb() const
|
||||||
{
|
{
|
||||||
return CNetworkWatchdog::isDbUrl(this->getUrl());
|
return this->getUrl().getHost() == getDbUrl().getHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDatabaseReader::JsonDatastoreResponse::setJsonArray(const QJsonArray &value)
|
void CDatabaseReader::JsonDatastoreResponse::setJsonArray(const QJsonArray &value)
|
||||||
|
|||||||
@@ -96,12 +96,6 @@ namespace BlackCore::Db
|
|||||||
m_workingSharedUrl = workingUrl;
|
m_workingSharedUrl = workingUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CNetworkWatchdog::isDbUrl(const CUrl &url)
|
|
||||||
{
|
|
||||||
const QString host(url.getHost());
|
|
||||||
return host == dbHost();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CNetworkWatchdog::doWork()
|
void CNetworkWatchdog::doWork()
|
||||||
{
|
{
|
||||||
if (!this->doWorkCheck()) { return; }
|
if (!this->doWorkCheck()) { return; }
|
||||||
@@ -353,12 +347,6 @@ namespace BlackCore::Db
|
|||||||
return testUrl;
|
return testUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CNetworkWatchdog::dbHost()
|
|
||||||
{
|
|
||||||
const QString host = dbTestUrl().getHost();
|
|
||||||
return host;
|
|
||||||
}
|
|
||||||
|
|
||||||
CUrl CNetworkWatchdog::workingSharedUrlFromSetup()
|
CUrl CNetworkWatchdog::workingSharedUrlFromSetup()
|
||||||
{
|
{
|
||||||
const CUrlList urls(sApp->getGlobalSetup().getSwiftSharedUrls());
|
const CUrlList urls(sApp->getGlobalSetup().getSwiftSharedUrls());
|
||||||
|
|||||||
@@ -126,10 +126,6 @@ namespace BlackCore::Db
|
|||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
bool isNetworkAccessibilityCheckEnabled() const { return !this->isNetworkAccessibilityCheckDisabled(); }
|
bool isNetworkAccessibilityCheckEnabled() const { return !this->isNetworkAccessibilityCheckDisabled(); }
|
||||||
|
|
||||||
//! URL referring to the DB
|
|
||||||
//! \remark depends on BlackCore::Application::getGlobalSetup()
|
|
||||||
static bool isDbUrl(const BlackMisc::Network::CUrl &url);
|
|
||||||
|
|
||||||
//! The URL being tested
|
//! The URL being tested
|
||||||
//! \remark depends on BlackCore::Application::getGlobalSetup()
|
//! \remark depends on BlackCore::Application::getGlobalSetup()
|
||||||
//! \private primarily accessible for unit tests
|
//! \private primarily accessible for unit tests
|
||||||
@@ -164,10 +160,6 @@ namespace BlackCore::Db
|
|||||||
//! Received reply of client service ping
|
//! Received reply of client service ping
|
||||||
void replyPingClientService(QNetworkReply *nwReply);
|
void replyPingClientService(QNetworkReply *nwReply);
|
||||||
|
|
||||||
//! The DB server
|
|
||||||
//! \remark depends on BlackCore::Application::getGlobalSetup()
|
|
||||||
static QString dbHost();
|
|
||||||
|
|
||||||
//! Obtain working DB data file location URL
|
//! Obtain working DB data file location URL
|
||||||
//! \remark depends on BlackCore::Application::getGlobalSetup()
|
//! \remark depends on BlackCore::Application::getGlobalSetup()
|
||||||
static BlackMisc::Network::CUrl workingSharedUrlFromSetup();
|
static BlackMisc::Network::CUrl workingSharedUrlFromSetup();
|
||||||
|
|||||||
Reference in New Issue
Block a user