fix: финализация fix6 для production runtime и reconfigure
This commit is contained in:
+2
-14
@@ -54,22 +54,10 @@ func InitSql(port string) error {
|
||||
return err
|
||||
}
|
||||
if port != "" {
|
||||
var result string
|
||||
db, err := sqliteDB.DB()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := db.QueryRow("SELECT value from config where key = 'H_UI_WEB_PORT' limit 1").Scan(&result); err != nil {
|
||||
logrus.Errorf("sqlite exec err: %v", err)
|
||||
if tx := sqliteDB.Exec("UPDATE config set value = ? where key = 'H_UI_WEB_PORT'", port); tx.Error != nil {
|
||||
logrus.Errorf("sqlite exec err: %v", tx.Error)
|
||||
return errors.New("sqlite exec err")
|
||||
}
|
||||
|
||||
if result == "8081" {
|
||||
if tx := sqliteDB.Exec("UPDATE config set value = ? where key = 'H_UI_WEB_PORT'", port); tx.Error != nil {
|
||||
logrus.Errorf("sqlite exec err: %v", tx.Error)
|
||||
return errors.New("sqlite exec err")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err := ensureAccountSchema(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user