diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-10-25 19:41:53 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-10-25 19:41:53 +0200 |
commit | 51976cf367b703589aa471766a481c1e0f74712d (patch) | |
tree | 56c6cdc5ff2395197de4c5e93226cb4d668940b8 | |
parent | Properly close cursors before commit and db deletion (diff) | |
download | nheko-51976cf367b703589aa471766a481c1e0f74712d.tar.xz |
Fix linting
-rw-r--r-- | src/Cache.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp index a5d970ca..f110fef3 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -1724,9 +1724,9 @@ Cache::runMigrations() [this]() { // migrate olm sessions to a single db try { - auto txn = lmdb::txn::begin(env_, nullptr); - auto mainDb = lmdb::dbi::open(txn); - auto dbNames = lmdb::cursor::open(txn, mainDb); + auto txn = lmdb::txn::begin(env_, nullptr); + auto mainDb = lmdb::dbi::open(txn); + auto dbNames = lmdb::cursor::open(txn, mainDb); bool doCommit = false; std::string_view dbName; @@ -1734,7 +1734,7 @@ Cache::runMigrations() if (!dbName.starts_with("olm_sessions.v2/")) continue; - doCommit = true; + doCommit = true; auto curveKey = dbName; curveKey.remove_prefix(std::string_view("olm_sessions.v2/").size()); @@ -1754,7 +1754,8 @@ Cache::runMigrations() } dbNames.close(); - if (doCommit) txn.commit(); + if (doCommit) + txn.commit(); } catch (const lmdb::error &e) { nhlog::db()->critical("Failed to convert olm sessions database in migration! {}", e.what()); |