From 36d0c8d1d781d80e4bee71208d72ea5a1f8e1fec Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 Jan 2021 22:35:54 +0300 Subject: we import slower, but more securely (flush database time to time) --- plugins/Dbx_mdbx/src/dbintf.cpp | 8 ++++++++ plugins/Dbx_mdbx/src/dbintf.h | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'plugins/Dbx_mdbx/src') diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp index bb46a1ddb6..5fbfdf1f69 100644 --- a/plugins/Dbx_mdbx/src/dbintf.cpp +++ b/plugins/Dbx_mdbx/src/dbintf.cpp @@ -228,6 +228,14 @@ int CDbxMDBX::Load() ///////////////////////////////////////////////////////////////////////////////////////// +BOOL CDbxMDBX::Flush() +{ + DBFlush(true); + return ERROR_SUCCESS; +} + +///////////////////////////////////////////////////////////////////////////////////////// + static void assert_func(const MDBX_env*, const char *msg, const char *function, unsigned line) MDBX_CXX17_NOEXCEPT { Netlib_Logf(nullptr, "MDBX: assertion failed (%s, %d): %s", function, line, msg); diff --git a/plugins/Dbx_mdbx/src/dbintf.h b/plugins/Dbx_mdbx/src/dbintf.h index 02f4ad8689..4b6aac5804 100644 --- a/plugins/Dbx_mdbx/src/dbintf.h +++ b/plugins/Dbx_mdbx/src/dbintf.h @@ -279,8 +279,9 @@ public: STDMETHODIMP_(BOOL) ReadCryptoKey(MBinBuffer&) override; STDMETHODIMP_(BOOL) StoreCryptoKey(void) override; - STDMETHODIMP_(BOOL) Compact(); - STDMETHODIMP_(BOOL) Backup(const wchar_t*); + STDMETHODIMP_(BOOL) Compact() override; + STDMETHODIMP_(BOOL) Backup(const wchar_t*) override; + STDMETHODIMP_(BOOL) Flush() override; STDMETHODIMP_(MEVENT) GetEventById(const char *szModule, const char *szId) override; -- cgit v1.2.3