This commit is contained in:
YouROK
2020-11-30 23:32:51 +03:00
parent 0569ade7b8
commit ee7902cbb6
5 changed files with 13 additions and 12 deletions

View File

@@ -10,6 +10,8 @@ import (
"github.com/alexflint/go-arg"
"server"
"server/log"
"server/settings"
"server/version"
)
@@ -41,11 +43,11 @@ func main() {
if params.Add != "" {
add()
}
settings.Path = params.Path
Preconfig(params.DontKill)
server.Start(params.Path, params.Port, params.RDB)
fmt.Println(server.WaitServer())
server.Start(params.Port, params.RDB)
log.TLogln(server.WaitServer())
time.Sleep(time.Second * 3)
os.Exit(0)
}

View File

@@ -5,8 +5,8 @@ import (
"server/web"
)
func Start(settingsPath, port string, roSets bool) {
settings.InitSets(settingsPath, roSets)
func Start(port string, roSets bool) {
settings.InitSets(roSets)
if port == "" {
port = "8090"
}

View File

@@ -14,8 +14,8 @@ type TDB struct {
db *bolt.DB
}
func NewTDB(path string, readOnly bool) *TDB {
db, err := bolt.Open(filepath.Join(path, "config.db"), 0666, nil)
func NewTDB(readOnly bool) *TDB {
db, err := bolt.Open(filepath.Join(Path, "config.db"), 0666, nil)
if err != nil {
log.TLogln(err)
return nil
@@ -23,7 +23,7 @@ func NewTDB(path string, readOnly bool) *TDB {
tdb := new(TDB)
tdb.db = db
tdb.Path = path
tdb.Path = Path
tdb.ReadOnly = readOnly
return tdb
}

View File

@@ -5,9 +5,8 @@ var (
Path string
)
func InitSets(path string, readOnly bool) {
Path = path
tdb = NewTDB(path, readOnly)
func InitSets(readOnly bool) {
tdb = NewTDB(readOnly)
loadBTSets()
}

View File

@@ -1,4 +1,4 @@
package version
const Version = "1.2.78_"
const Version = "1.2.78_1"
const VerInt = 78