mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #476, improvements on gracefulShutdown
* gracefulShutdown in metar reader and other readers * made m_shutdown thread safe * Demoted log level for reader * helper function finished or shutdown
This commit is contained in:
committed by
Mathew Sutcliffe
parent
54448fd2b2
commit
4d3d9fa6be
@@ -76,7 +76,7 @@ namespace BlackCore
|
||||
this->threadAssertCheck();
|
||||
|
||||
// Worker thread, make sure to write thread safe!
|
||||
if (this->isFinished())
|
||||
if (this->isFinishedOrShutdown())
|
||||
{
|
||||
CLogMessage(this).debug() << Q_FUNC_INFO;
|
||||
CLogMessage(this).info("terminated METAR decoding process"); // for users
|
||||
@@ -94,6 +94,7 @@ namespace BlackCore
|
||||
QTextStream lineReader(&metarData);
|
||||
while (!lineReader.atEnd())
|
||||
{
|
||||
if (this->isFinishedOrShutdown()) { return; }
|
||||
QString line = lineReader.readLine();
|
||||
CMetar metar = m_metarDecoder.decode(line);
|
||||
if (metar != CMetar())
|
||||
@@ -117,7 +118,8 @@ namespace BlackCore
|
||||
Q_UNUSED(invalidMetars);
|
||||
if (invalidLineCount > 0)
|
||||
{
|
||||
CLogMessage(this).warning("Reading METARs failed for %1 entries") << invalidLineCount;
|
||||
// Regular issue, log it, but do not show to user
|
||||
CLogMessage(this).debug() << "Reading METARs failed for entries" << invalidLineCount;
|
||||
}
|
||||
emit metarsRead(metars);
|
||||
emit dataRead(CEntityFlags::MetarEntity, CEntityFlags::ReadFinished, metars.size());
|
||||
|
||||
Reference in New Issue
Block a user