DB reader, doWorkCheck before writing cache. In case shutdown takes place in-between.

This commit is contained in:
Klaus Basan
2018-04-04 00:04:04 +02:00
parent 57b3760b61
commit 7d106acdee
4 changed files with 10 additions and 3 deletions

View File

@@ -292,6 +292,7 @@ namespace BlackCore
Q_FUNC_INFO);
}
if (!this->doWorkCheck()) { return; }
const int n = codes.size();
qint64 latestTimestamp = codes.latestTimestampMsecsSinceEpoch(); // ignores duplicates
if (n > 0 && latestTimestamp < 0)
@@ -342,6 +343,7 @@ namespace BlackCore
Q_FUNC_INFO);
}
if (!this->doWorkCheck()) { return; }
const int n = codes.size();
qint64 latestTimestamp = codes.latestTimestampMsecsSinceEpoch();
if (n > 0 && latestTimestamp < 0)
@@ -382,6 +384,7 @@ namespace BlackCore
countries = CCountryList::fromDatabaseJson(res);
}
if (!this->doWorkCheck()) { return; }
const int n = countries.size();
qint64 latestTimestamp = countries.latestTimestampMsecsSinceEpoch();
if (n > 0 && latestTimestamp < 0)