mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 11:25:33 +08:00
Ref T292, Ref T285 avoid unnecessary calls of cache synchronize in DB readers
Rational: Normally calling synchronize multiple times does not matter. However, it can time out if the cache is in use (e.g. saving) and create an exception. This exception is just unwanted "noise".
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
#include "blackcore/db/databasereader.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <atomic>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
@@ -73,7 +75,8 @@ namespace BlackCore
|
||||
BlackMisc::Db::CDbFlags::DataRetrievalModeFlag mode = BlackMisc::Db::CDbFlags::DbReading, const QDateTime &newerThan = QDateTime());
|
||||
|
||||
private:
|
||||
BlackMisc::CData<BlackCore::Data::TDbAirportCache> m_airportCache {this, &CAirportDataReader::airportCacheChanged};
|
||||
BlackMisc::CData<BlackCore::Data::TDbAirportCache> m_airportCache {this, &CAirportDataReader::airportCacheChanged}; //!< cache file
|
||||
std::atomic_bool m_syncedAirportCache { false }; //!< already synchronized?
|
||||
|
||||
//! Reader URL (we read from where?) used to detect changes of location
|
||||
BlackMisc::CData<BlackCore::Data::TDbModelReaderBaseUrl> m_readerUrlCache {this, &CAirportDataReader::baseUrlCacheChanged };
|
||||
|
||||
Reference in New Issue
Block a user