refs #664 Fixed bug in data cache log message creation.

This commit is contained in:
Mathew Sutcliffe
2016-05-26 18:01:42 +01:00
parent fa7aa6446b
commit 4bc8326389
3 changed files with 6 additions and 6 deletions

View File

@@ -243,7 +243,7 @@ namespace BlackMisc
if (! lock) { return; }
m_cache->m_revision.writeNewRevision(baseline.toTimestampMap());
auto msg = m_cache->saveToFiles(persistentStore(), values, baseline.toTimestampMapString());
auto msg = m_cache->saveToFiles(persistentStore(), values, baseline.toTimestampMapString(values.keys()));
msg.setCategories(this);
CLogMessage::preformatted(msg);

View File

@@ -91,13 +91,13 @@ namespace BlackMisc
return result;
}
QString CValueCachePacket::toTimestampMapString() const
QString CValueCachePacket::toTimestampMapString(const QStringList &keys) const
{
auto map = toTimestampMap();
QStringList result;
for (auto it = map.cbegin(); it != map.cend(); ++it)
for (const auto &key : keys)
{
result.push_back(it.key() + "(" + QDateTime::fromMSecsSinceEpoch(it.value(), Qt::UTC).toString(Qt::ISODate) + ")");
QString time = contains(key) ? QDateTime::fromMSecsSinceEpoch(value(key).second, Qt::UTC).toString(Qt::ISODate) : "no timestamp";
result.push_back(key + "(" + time + ")");
}
return result.join(",");
}

View File

@@ -94,7 +94,7 @@ namespace BlackMisc
QMap<QString, qint64> toTimestampMap() const;
//! Return map of timestamps converted to string.
QString toTimestampMapString() const;
QString toTimestampMapString(const QStringList &keys) const;
//! Remove value matching the given key, and return it in a separate packet.
CValueCachePacket takeByKey(const QString &key);