From 5110fa3a13c97ecbc7ef35e27bc911eeb3f84555 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Wed, 24 Aug 2022 16:07:32 +0700 Subject: [PATCH] save --- kv/mdbx/kv_mdbx.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kv/mdbx/kv_mdbx.go b/kv/mdbx/kv_mdbx.go index a6302a6af..092e694e2 100644 --- a/kv/mdbx/kv_mdbx.go +++ b/kv/mdbx/kv_mdbx.go @@ -121,6 +121,7 @@ func (opts MdbxOpts) Set(opt MdbxOpts) MdbxOpts { func (opts MdbxOpts) InMem() MdbxOpts { opts.inMem = true opts.flags = mdbx.UtterlyNoSync | mdbx.NoMetaSync | mdbx.LifoReclaim | mdbx.WriteMap + opts.mapSize = 64 * datasize.MB return opts } @@ -188,9 +189,7 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) { } if opts.mapSize == 0 { - if opts.inMem { - opts.mapSize = 64 * datasize.MB - } else { + if !opts.inMem { opts.mapSize = 3 * datasize.TB } }