Utility function to directly log warning when network not accessible

This commit is contained in:
Klaus Basan
2017-07-11 20:03:24 +02:00
committed by Mathew Sutcliffe
parent 8aed8f598e
commit 76b3b6c0b6
7 changed files with 16 additions and 33 deletions

View File

@@ -64,11 +64,7 @@ namespace BlackCore
{
this->threadAssertCheck();
if (!this->doWorkCheck()) { return; }
if (!this->isNetworkAccessible())
{
CLogMessage(this).warning("No network, cannot read VATSIM bookings");
return;
}
if (!this->isNetworkAccessible("No network, cannot read VATSIM bookings")) { return; }
Q_ASSERT_X(sApp, Q_FUNC_INFO, "No application");
const QUrl url(sApp->getGlobalSetup().getVatsimBookingsUrl());

View File

@@ -183,11 +183,7 @@ namespace BlackCore
{
this->threadAssertCheck();
if (!this->doWorkCheck()) { return; }
if (!this->isNetworkAccessible())
{
CLogMessage(this).warning("No network, cannot read VATSIM data file");
return;
}
if (!this->isNetworkAccessible("No network, cannot read VATSIM data file")) { return; }
// round robin for load balancing
// remark: Don't use QThread to run network operations in the background

View File

@@ -76,11 +76,7 @@ namespace BlackCore
{
this->threadAssertCheck();
if (!this->doWorkCheck()) { return; }
if (!this->isNetworkAccessible())
{
CLogMessage(this).warning("No network, cannot read METARs");
return;
}
if (!this->isNetworkAccessible("No network, cannot read METARs")) { return; }
CFailoverUrlList urls(sApp->getVatsimMetarUrls());
const CUrl url(urls.obtainNextWorkingUrl(true));

View File

@@ -66,11 +66,7 @@ namespace BlackCore
{
this->threadAssertCheck();
if (!this->doWorkCheck()) { return; }
if (!this->isNetworkAccessible())
{
CLogMessage(this).warning("No network, cannot read VATSIM status file");
return;
}
if (!this->isNetworkAccessible("No network, cannot read VATSIM status file")) { return; }
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing application");
CFailoverUrlList urls(sApp->getGlobalSetup().getVatsimStatusFileUrls());