writecache: provide timeout to bbolt.Open

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-06-09 14:08:13 +03:00 committed by fyrchik
parent 68a0112193
commit 38772e1a2e

View file

@ -3,6 +3,7 @@ package writecache
import ( import (
"os" "os"
"path/filepath" "path/filepath"
"time"
"go.etcd.io/bbolt" "go.etcd.io/bbolt"
) )
@ -13,5 +14,6 @@ func OpenDB(p string, ro bool) (*bbolt.DB, error) {
NoFreelistSync: true, NoFreelistSync: true,
NoSync: true, NoSync: true,
ReadOnly: ro, ReadOnly: ro,
Timeout: 100 * time.Millisecond,
}) })
} }