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