Ignore sessions that cannot be parsed
This commit is contained in:
parent
a9ddc3b3d3
commit
9ad4aab657
@ -224,9 +224,16 @@ Cache::exportSessionKeys()
|
|||||||
std::string key, value;
|
std::string key, value;
|
||||||
while (cursor.get(key, value, MDB_NEXT)) {
|
while (cursor.get(key, value, MDB_NEXT)) {
|
||||||
ExportedSession exported;
|
ExportedSession exported;
|
||||||
|
MegolmSessionIndex index;
|
||||||
|
|
||||||
auto saved_session = unpickle<InboundSessionObject>(value, SECRET);
|
auto saved_session = unpickle<InboundSessionObject>(value, SECRET);
|
||||||
auto index = nlohmann::json::parse(key).get<MegolmSessionIndex>();
|
|
||||||
|
try {
|
||||||
|
index = nlohmann::json::parse(key).get<MegolmSessionIndex>();
|
||||||
|
} catch (const nlohmann::json::exception &e) {
|
||||||
|
nhlog::db()->critical("failed to export megolm session: {}", e.what());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
exported.room_id = index.room_id;
|
exported.room_id = index.room_id;
|
||||||
exported.sender_key = index.sender_key;
|
exported.sender_key = index.sender_key;
|
||||||
|
Loading…
Reference in New Issue
Block a user