aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-04-07 03:21:46 +0300
committerTulir Asokan <tulir@maunium.net>2019-04-07 03:21:46 +0300
commitb81ba7b631b5243bd61514db1787a3f9043990e0 (patch)
tree08461de6fe1f1baa1703ecadb7a25edd536a5027 /matrix
parente9cf38a86607d9b41914fa7442661a4dd56ce0a0 (diff)
Add timeout to opening history db
Diffstat (limited to 'matrix')
-rw-r--r--matrix/history.go6
1 files changed, 5 insertions, 1 deletions
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
}