mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix linting
This commit is contained in:
parent
465a67bfaf
commit
51976cf367
1 changed files with 6 additions and 5 deletions
|
@ -1724,9 +1724,9 @@ Cache::runMigrations()
|
||||||
[this]() {
|
[this]() {
|
||||||
// migrate olm sessions to a single db
|
// migrate olm sessions to a single db
|
||||||
try {
|
try {
|
||||||
auto txn = lmdb::txn::begin(env_, nullptr);
|
auto txn = lmdb::txn::begin(env_, nullptr);
|
||||||
auto mainDb = lmdb::dbi::open(txn);
|
auto mainDb = lmdb::dbi::open(txn);
|
||||||
auto dbNames = lmdb::cursor::open(txn, mainDb);
|
auto dbNames = lmdb::cursor::open(txn, mainDb);
|
||||||
bool doCommit = false;
|
bool doCommit = false;
|
||||||
|
|
||||||
std::string_view dbName;
|
std::string_view dbName;
|
||||||
|
@ -1734,7 +1734,7 @@ Cache::runMigrations()
|
||||||
if (!dbName.starts_with("olm_sessions.v2/"))
|
if (!dbName.starts_with("olm_sessions.v2/"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
doCommit = true;
|
doCommit = true;
|
||||||
auto curveKey = dbName;
|
auto curveKey = dbName;
|
||||||
curveKey.remove_prefix(std::string_view("olm_sessions.v2/").size());
|
curveKey.remove_prefix(std::string_view("olm_sessions.v2/").size());
|
||||||
|
|
||||||
|
@ -1754,7 +1754,8 @@ Cache::runMigrations()
|
||||||
}
|
}
|
||||||
dbNames.close();
|
dbNames.close();
|
||||||
|
|
||||||
if (doCommit) txn.commit();
|
if (doCommit)
|
||||||
|
txn.commit();
|
||||||
} catch (const lmdb::error &e) {
|
} catch (const lmdb::error &e) {
|
||||||
nhlog::db()->critical("Failed to convert olm sessions database in migration! {}",
|
nhlog::db()->critical("Failed to convert olm sessions database in migration! {}",
|
||||||
e.what());
|
e.what());
|
||||||
|
|
Loading…
Reference in a new issue