refactor to MariaDB-only runtime and simplify PriceForge
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user