mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
DB reader, doWorkCheck before writing cache. In case shutdown takes place in-between.
This commit is contained in:
@@ -301,6 +301,7 @@ namespace BlackCore
|
||||
liveries = CLiveryList::fromDatabaseJson(res);
|
||||
}
|
||||
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
const int n = liveries.size();
|
||||
qint64 latestTimestamp = liveries.latestTimestampMsecsSinceEpoch();
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
@@ -343,6 +344,7 @@ namespace BlackCore
|
||||
distributors = CDistributorList::fromDatabaseJson(res);
|
||||
}
|
||||
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
const int n = distributors.size();
|
||||
qint64 latestTimestamp = distributors.latestTimestampMsecsSinceEpoch();
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
@@ -386,6 +388,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
// synchronized update
|
||||
if (!this->doWorkCheck()) { return; }
|
||||
const int n = models.size();
|
||||
qint64 latestTimestamp = models.latestTimestampMsecsSinceEpoch();
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
|
||||
Reference in New Issue
Block a user