mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 05:27:19 +00:00
save
This commit is contained in:
parent
3cd34cc900
commit
bf912d4eaa
@ -58,6 +58,22 @@ func WriteMap() bool {
|
||||
return writeMap
|
||||
}
|
||||
|
||||
var (
|
||||
noSync bool
|
||||
noSyncOnce sync.Once
|
||||
)
|
||||
|
||||
func NoSync() bool {
|
||||
noSyncOnce.Do(func() {
|
||||
v, _ := os.LookupEnv("NO_SYNC")
|
||||
if v == "true" {
|
||||
noSync = true
|
||||
log.Info("[Experiment]", "NO_SYNC", noSync)
|
||||
}
|
||||
})
|
||||
return noSync
|
||||
}
|
||||
|
||||
var (
|
||||
mergeTr int
|
||||
mergeTrOnce sync.Once
|
||||
|
@ -177,6 +177,9 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) {
|
||||
if dbg.WriteMap() {
|
||||
opts = opts.WriteMap() //nolint
|
||||
}
|
||||
if dbg.NoSync() {
|
||||
opts = opts.Flags(func(u uint) uint { return u | mdbx.SafeNoSync }) //nolint
|
||||
}
|
||||
if dbg.MergeTr() > 0 {
|
||||
opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192)) //nolint
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user