writecache: provide timeout to bbolt.Open
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
68a0112193
commit
38772e1a2e
1 changed files with 2 additions and 0 deletions
|
@ -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,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue