mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
refs #664 Fixed bug in data cache log message creation.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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(",");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user