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