fix indefinite start on locked db

This commit is contained in:
nikk gitanes
2022-05-26 15:26:43 +03:00
parent e46f247679
commit d38a63a4af
3 changed files with 4 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package settings
import (
"path/filepath"
"strings"
"time"
"server/log"
@@ -15,7 +16,7 @@ type TDB struct {
}
func NewTDB() *TDB {
db, err := bolt.Open(filepath.Join(Path, "config.db"), 0666, nil)
db, err := bolt.Open(filepath.Join(Path, "config.db"), 0666, &bolt.Options{Timeout: 5 * time.Second})
if err != nil {
log.TLogln(err)
return nil