mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Turn metasync and sync back on for the database to account for bad filesystems
This commit is contained in:
parent
7f825e3ee8
commit
d8669ccf3d
1 changed files with 4 additions and 1 deletions
|
@ -293,7 +293,10 @@ Cache::setup()
|
||||||
// NOTE(Nico): We may want to use (MDB_MAPASYNC | MDB_WRITEMAP) in the future, but
|
// 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
|
// it can really mess up our database, so we shouldn't. For now, hopefully
|
||||||
// NOMETASYNC is fast enough.
|
// NOMETASYNC is fast enough.
|
||||||
env_.open(cacheDirectory_.toStdString().c_str(), MDB_NOMETASYNC | MDB_NOSYNC);
|
//
|
||||||
|
// 2022-10-28: Disable the nosync flags again in the hope to crack down on some database
|
||||||
|
// corruption.
|
||||||
|
env_.open(cacheDirectory_.toStdString().c_str()); //, MDB_NOMETASYNC | MDB_NOSYNC);
|
||||||
} 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" + std::string(e.what()));
|
throw std::runtime_error("LMDB initialization failed" + std::string(e.what()));
|
||||||
|
|
Loading…
Reference in a new issue