mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
refactor: Remove CNetworkWatchdog
The watchdog was used in a few places as a shortcut to skip reading data. Further, it was used in some places in the UI to display connectivity. But it also introduced quite some complexity. In some cases it can be fragile: network accessibilty cannot be looked up on all platforms/hardware constellations. The connectivity could change between the last watchdog call and the real call. Hence all readers must still handle the case where the connection fails. To simplify swift and further reduce the dependency onto the project infrastructure (pings etc.), this removes the watchdog. This also removes the QNetworkConfigurationManager, which is deprecated and not available with Qt6.
This commit is contained in:
@@ -282,11 +282,6 @@ namespace BlackCore
|
||||
{
|
||||
if (m_shuttingDown) { return CEntityFlags::NoEntity; }
|
||||
if (!sApp || sApp->isShuttingDown()) { return CEntityFlags::NoEntity; }
|
||||
if (!sApp->isSwiftDbAccessible())
|
||||
{
|
||||
CLogMessage(this).warning(u"Not triggering load of '%1' because swift DB is not accessible") << CEntityFlags::flagToString(whatToRead);
|
||||
return CEntityFlags::NoEntity;
|
||||
}
|
||||
|
||||
CEntityFlags::Entity triggeredRead = CEntityFlags::NoEntity;
|
||||
if (m_dbInfoDataReader)
|
||||
@@ -1013,20 +1008,10 @@ namespace BlackCore
|
||||
// 1a. If any DB data, read the info objects upfront
|
||||
if (needsDbInfoObjects)
|
||||
{
|
||||
const bool databaseUp = sApp->isSwiftDbAccessible();
|
||||
if (!databaseUp) { dbReaderConfig.markAsDbDown(); }
|
||||
|
||||
if (anyDbEntities && readersNeeded.testFlag(CWebReaderFlags::WebReaderFlag::DbInfoDataReader))
|
||||
{
|
||||
// info data reader has a special role, it will not be triggered in triggerRead()
|
||||
if (databaseUp)
|
||||
{
|
||||
this->initDbInfoObjectReaderAndTriggerRead();
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).warning(u"DB unreachable, skipping read from DB info data reader");
|
||||
}
|
||||
this->initDbInfoObjectReaderAndTriggerRead();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user