refactor to MariaDB-only runtime and simplify PriceForge

This commit is contained in:
2026-02-07 21:38:55 +03:00
parent 20309d1f0e
commit 005478ac6b
37 changed files with 302 additions and 10324 deletions

View File

@@ -14,8 +14,8 @@ import (
qfassets "git.mchus.pro/mchus/priceforge"
"git.mchus.pro/mchus/priceforge/internal/db"
"git.mchus.pro/mchus/priceforge/internal/localdb"
mysqlDriver "github.com/go-sql-driver/mysql"
"github.com/gin-gonic/gin"
mysqlDriver "github.com/go-sql-driver/mysql"
gormmysql "gorm.io/driver/mysql"
"gorm.io/gorm"
"gorm.io/gorm/logger"
@@ -211,11 +211,13 @@ func (h *SetupHandler) SaveConnection(c *gin.Context) {
existingSettings.User != user ||
existingSettings.PasswordEncrypted != password
restartQueued := settingsChanged && h.restartSig != nil
// Always restart after successful save in normal mode so handlers are reinitialized
// with a fresh MariaDB connection state.
restartQueued := h.restartSig != nil
c.JSON(http.StatusOK, gin.H{
"success": true,
"message": "Settings saved.",
"restart_required": settingsChanged,
"restart_required": settingsChanged || restartQueued,
"restart_queued": restartQueued,
})