refs #649, skip reading of info objects if only caches are used and emit signals when syncronized from cache

(applied after 1st performance fix for cache was ready)
* utility functions to detect if only caches are used
* renamed some functions
* renamed some db flags and added new ones
This commit is contained in:
Klaus Basan
2016-06-05 15:52:44 +02:00
parent c31145b3a0
commit f02bf0ac0a
16 changed files with 159 additions and 89 deletions

View File

@@ -30,7 +30,8 @@ namespace BlackCore
CInfoDataReader::CInfoDataReader(QObject *owner, const CDatabaseReaderConfigList &config) :
CDatabaseReader(owner, config, "CInfoDataReader")
{
// void
// init to avoid threading issues
getBaseUrl();
}
CDbInfoList CInfoDataReader::getDbInfoObjects() const
@@ -121,6 +122,8 @@ namespace BlackCore
// wrap pointer, make sure any exit cleans up reply
// required to use delete later as object is created in a different thread
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
if (this->isAbandoned()) { return; }
QString urlString(nwReply->url().toString());
CDatabaseReader::JsonDatastoreResponse res = this->setStatusAndTransformReplyIntoDatastoreResponse(nwReply.data());
if (res.hasErrorMessage())
@@ -146,9 +149,9 @@ namespace BlackCore
CLogMessage(this).info("Read %1 %2 from %3") << n << CEntityFlags::flagToString(CEntityFlags::InfoObjectEntity) << urlString;
}
CUrl CInfoDataReader::getBaseUrl() const
const CUrl &CInfoDataReader::getBaseUrl()
{
const CUrl baseUrl(sApp->getGlobalSetup().getDbInfoReaderUrl());
static const CUrl baseUrl(sApp->getGlobalSetup().getDbInfoReaderUrl());
return baseUrl;
}
@@ -156,6 +159,5 @@ namespace BlackCore
{
return getBaseUrl().withAppendedPath("service/jsondbinfo.php");
}
} // namespace
} // namespace