mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
refs #568, allow to read incremental data based on timestamp
* signatures with QDateTime * flags
This commit is contained in:
@@ -24,11 +24,14 @@ namespace BlackCore
|
||||
connect(&m_watchdogTimer, &QTimer::timeout, this, &CDatabaseReader::ps_watchdog);
|
||||
}
|
||||
|
||||
void CDatabaseReader::readInBackgroundThread(CEntityFlags::Entity entities)
|
||||
void CDatabaseReader::readInBackgroundThread(CEntityFlags::Entity entities, const QDateTime &newerThan)
|
||||
{
|
||||
if (isAbandoned()) { return; }
|
||||
this->m_watchdogTimer.stop();
|
||||
bool s = QMetaObject::invokeMethod(this, "ps_read", Q_ARG(BlackMisc::Network::CEntityFlags::Entity, entities));
|
||||
// ps_read is implemented in the derived classes
|
||||
bool s = QMetaObject::invokeMethod(this, "ps_read",
|
||||
Q_ARG(BlackMisc::Network::CEntityFlags::Entity, entities),
|
||||
Q_ARG(QDateTime, newerThan));
|
||||
Q_ASSERT_X(s, Q_FUNC_INFO, "Invoke failed");
|
||||
Q_UNUSED(s);
|
||||
}
|
||||
@@ -63,6 +66,7 @@ namespace BlackCore
|
||||
datastoreResponse.jsonArray = responseObject["data"].toArray();
|
||||
QString ts(responseObject["latest"].toString());
|
||||
datastoreResponse.updated = ts.isEmpty() ? QDateTime::currentDateTimeUtc() : CDatastoreUtility::parseTimestamp(ts);
|
||||
datastoreResponse.restricted = responseObject["restricted"].toBool();
|
||||
}
|
||||
return datastoreResponse;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user