mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 01:05:35 +08:00
refs #712, improved readers
* only trigger read when network interface is available * do not trigger all reads at same time but slightly shifted * renamed to hasReceivedOkReply()
This commit is contained in:
@@ -67,6 +67,13 @@ namespace BlackCore
|
||||
|
||||
void CVatsimBookingReader::ps_read()
|
||||
{
|
||||
if (!this->isNetworkAvailable())
|
||||
{
|
||||
CLogMessage(this).warning("No network, cancel bookings reader");
|
||||
this->m_updateTimer->stop();
|
||||
return;
|
||||
}
|
||||
|
||||
this->threadAssertCheck();
|
||||
this->restartTimer(true); // when timer active, restart so we cause no undesired reads
|
||||
|
||||
|
||||
@@ -186,6 +186,13 @@ namespace BlackCore
|
||||
|
||||
void CVatsimDataFileReader::ps_read()
|
||||
{
|
||||
if (!this->isNetworkAvailable())
|
||||
{
|
||||
CLogMessage(this).warning("No network, cancel data file reader");
|
||||
this->m_updateTimer->stop();
|
||||
return;
|
||||
}
|
||||
|
||||
this->threadAssertCheck();
|
||||
this->restartTimer(true); // when timer active, restart so we cause no undesired reads
|
||||
|
||||
|
||||
@@ -80,6 +80,12 @@ namespace BlackCore
|
||||
void CVatsimMetarReader::readMetars()
|
||||
{
|
||||
if (this->isAbandoned()) { return; }
|
||||
if (!this->isNetworkAvailable())
|
||||
{
|
||||
CLogMessage(this).warning("No network, cancel METAR reader");
|
||||
this->m_updateTimer->stop();
|
||||
return;
|
||||
}
|
||||
this->threadAssertCheck();
|
||||
this->restartTimer(true); // when timer active, restart so we cause no undesired reads
|
||||
|
||||
|
||||
Reference in New Issue
Block a user