fix: финализация fix6 для production runtime и reconfigure

This commit is contained in:
2026-04-28 17:29:23 +05:00
parent 607689df9b
commit 087d9f616a
11 changed files with 34 additions and 85 deletions
+2 -14
View File
@@ -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 {