Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

kv: use SetSyncPeriod from mdbx-go v0.22.16 #358

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/matryer/moq v0.2.5
github.com/spaolacci/murmur3 v1.1.0
github.com/stretchr/testify v1.7.0
github.com/torquem-ch/mdbx-go v0.22.15
github.com/torquem-ch/mdbx-go v0.22.16
github.com/ugorji/go/codec v1.1.13
go.uber.org/atomic v1.9.0
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/torquem-ch/mdbx-go v0.22.15 h1:mFMP1lC0716ifEAvg8FoJ1iJCXww0UFe4aRgbfTRAYY=
github.com/torquem-ch/mdbx-go v0.22.15/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
github.com/torquem-ch/mdbx-go v0.22.16 h1:uSuQOAKSZC7TvV4N4km+6kyER2YxaOuL/0qybsQtlUY=
github.com/torquem-ch/mdbx-go v0.22.16/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
github.com/ugorji/go v1.1.13 h1:nB3O5kBSQGjEQAcfe1aLUYuxmXdFKmYgBZhY32rQb6Q=
github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc=
github.com/ugorji/go/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4=
Expand Down
4 changes: 1 addition & 3 deletions kv/mdbx/kv_mdbx.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) {
}

if opts.syncPeriod != 0 {
// the option value is in 1/65536 of second units
optValue := uint64(opts.syncPeriod / (time.Second / 65536))
if err = env.SetOption(mdbx.OptSyncPeriod, optValue); err != nil {
if err = env.SetSyncPeriod(opts.syncPeriod); err != nil {
env.Close()
return nil, err
}
Expand Down