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

Commit

Permalink
kv: use SetSyncPeriod from mdbx-go v0.22.16 (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
battlmonstr authored and Alexey Sharp committed Mar 14, 2022
1 parent da78ce7 commit a59fdf2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/matryer/moq v0.2.3
github.com/spaolacci/murmur3 v1.1.0
github.com/stretchr/testify v1.7.0
github.com/torquem-ch/mdbx-go v0.22.10
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 @@ -93,8 +93,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.10 h1:reevtNP74E9SN7ESnogJr8Q8CI/0JcSMJ9tghfaLAEQ=
github.com/torquem-ch/mdbx-go v0.22.10/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 @@ -223,9 +223,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

0 comments on commit a59fdf2

Please sign in to comment.