[#316] locode/boltdb: Add default timeout to open underlying BoltDB instance

Set timeout option of BoltDB Open operation to 3s in order to prevent
indefinite waiting for file lock.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-09 18:12:09 +03:00 committed by Leonard Lyubich
parent 97264acb26
commit 04b06ba539
2 changed files with 6 additions and 0 deletions

View file

@ -11,6 +11,8 @@ import (
)
// Open opens underlying BoltDB instance.
//
// Timeout of BoltDB opening is 3s (only for Linux or Darwin).
func (db *DB) Open() error {
// copy-paste from metabase:
// consider universal Open/Close for BoltDB wrappers