summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-01-31 22:35:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-01-31 22:35:54 +0300
commit36d0c8d1d781d80e4bee71208d72ea5a1f8e1fec (patch)
tree30aa8f85dda26de517982e3b5c3e6c6d3d18056a /plugins/Dbx_mdbx
parentc6b493f65d7d768782852b6379c663161b63695f (diff)
we import slower, but more securely (flush database time to time)
Diffstat (limited to 'plugins/Dbx_mdbx')
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.cpp8
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.h5
2 files changed, 11 insertions, 2 deletions
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;