add error if file db not open

This commit is contained in:
YouROK
2021-07-19 11:34:17 +03:00
parent 36b30e5960
commit a321fe3ea2

View File

@@ -1,5 +1,12 @@
package settings
import (
"os"
"path/filepath"
"server/log"
)
var (
tdb *TDB
Path string
@@ -10,6 +17,10 @@ var (
func InitSets(readOnly bool) {
ReadOnly = readOnly
tdb = NewTDB()
if tdb == nil {
log.TLogln("Error open db:", filepath.Join(Path, "config.db"))
os.Exit(1)
}
loadBTSets()
Migrate()
}