From b81ba7b631b5243bd61514db1787a3f9043990e0 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 7 Apr 2019 03:21:46 +0300 Subject: Add timeout to opening history db --- matrix/history.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matrix/history.go b/matrix/history.go index 1b99125..980b942 100644 --- a/matrix/history.go +++ b/matrix/history.go @@ -48,7 +48,11 @@ func NewHistoryManager(dbPath string) (*HistoryManager, error) { historyEndPtr: make(map[*rooms.Room]uint64), historyLoadPtr: make(map[*rooms.Room]uint64), } - db, err := bolt.Open(dbPath, 0600, nil) + db, err := bolt.Open(dbPath, 0600, &bolt.Options{ + Timeout: 1, + NoGrowSync: false, + FreelistType: bolt.FreelistArrayType, + }) if err != nil { return nil, err } -- cgit v1.2.3