mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 13:08:48 +03:00
Speedup db a bit, but loose some crash resiliency
The loss in durability shouldn't matter, if we can just receive the same events again after a restart
This commit is contained in:
parent
d6bc05fcd6
commit
9f79b85579
1 changed files with 4 additions and 1 deletions
|
@ -168,7 +168,10 @@ Cache::setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
env_.open(statePath.toStdString().c_str());
|
// NOTE(Nico): We may want to use (MDB_MAPASYNC | MDB_WRITEMAP) in the future, but
|
||||||
|
// it can really mess up our database, so we shouldn't. For now, hopefully
|
||||||
|
// NOMETASYNC is fast enough.
|
||||||
|
env_.open(statePath.toStdString().c_str(), MDB_NOMETASYNC);
|
||||||
} catch (const lmdb::error &e) {
|
} catch (const lmdb::error &e) {
|
||||||
if (e.code() != MDB_VERSION_MISMATCH && e.code() != MDB_INVALID) {
|
if (e.code() != MDB_VERSION_MISMATCH && e.code() != MDB_INVALID) {
|
||||||
throw std::runtime_error("LMDB initialization failed" +
|
throw std::runtime_error("LMDB initialization failed" +
|
||||||
|
|
Loading…
Reference in a new issue