mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #646 Added timestamps in data cache load/save log messages.
This commit is contained in:
@@ -234,7 +234,7 @@ namespace BlackMisc
|
||||
if (! lock) { return; }
|
||||
m_cache->m_revision.writeNewRevision(baseline.toTimestampMap());
|
||||
|
||||
auto msg = m_cache->saveToFiles(persistentStore(), values);
|
||||
auto msg = m_cache->saveToFiles(persistentStore(), values, baseline.toTimestampMapString());
|
||||
msg.setCategories(this);
|
||||
CLogMessage::preformatted(msg);
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace BlackMisc
|
||||
if (lock && m_cache->m_revision.isPendingRead())
|
||||
{
|
||||
CValueCachePacket newValues;
|
||||
auto msg = m_cache->loadFromFiles(persistentStore(), m_cache->m_revision.keysWithNewerTimestamps(), baseline.toVariantMap(), newValues);
|
||||
auto msg = m_cache->loadFromFiles(persistentStore(), m_cache->m_revision.keysWithNewerTimestamps(), baseline.toVariantMap(), newValues, m_cache->m_revision.timestampsAsString());
|
||||
msg.setCategories(this);
|
||||
CLogMessage::preformatted(msg);
|
||||
m_deferredChanges.insert(newValues);
|
||||
@@ -451,6 +451,18 @@ namespace BlackMisc
|
||||
return std::move(m_promises); // move into the return value, so m_promises becomes empty
|
||||
}
|
||||
|
||||
QString CDataCacheRevision::timestampsAsString() const
|
||||
{
|
||||
QMutexLocker lock(&m_mutex);
|
||||
|
||||
QStringList result;
|
||||
for (auto it = m_timestamps.cbegin(); it != m_timestamps.cend(); ++it)
|
||||
{
|
||||
result.push_back(it.key() + "(" + QDateTime::fromMSecsSinceEpoch(it.value(), Qt::UTC).toString(Qt::ISODate) + ")");
|
||||
}
|
||||
return result.join(",");
|
||||
}
|
||||
|
||||
void CDataCacheRevision::setTimeToLive(const QString &key, int ttl)
|
||||
{
|
||||
Q_ASSERT(! m_updateInProgress);
|
||||
|
||||
Reference in New Issue
Block a user