Ref T149, utility functions for pending URLs

* Do not call read twice in info reader
* Threadsafe utility functions
This commit is contained in:
Klaus Basan
2017-09-17 23:35:50 +02:00
committed by Mathew Sutcliffe
parent 52caf795d1
commit 0cf308450e
5 changed files with 50 additions and 0 deletions

View File

@@ -113,7 +113,15 @@ namespace BlackCore
void CInfoDataReader::read()
{
if (!this->doWorkCheck()) { return; }
const CUrl url(this->getInfoObjectsUrl());
const CUrlLogList urlLogList(this->getUrlLogList()); // thread safe copy
if (urlLogList.hasPending())
{
CLogMessage(this).info("Info data reading still pending, summary: '%1'") << urlLogList.getSummary();
return;
}
if (!url.isEmpty())
{
this->getFromNetworkAndLog(url, { this, &CInfoDataReader::parseInfoObjectsData});