feat: update ratio config if missing

This commit is contained in:
JustSong
2024-03-10 19:29:42 +08:00
parent 5b50eb94e5
commit 796be42487
3 changed files with 23 additions and 2 deletions

View File

@@ -81,6 +81,9 @@ func InitOptionMap() {
func loadOptionsFromDatabase() {
options, _ := AllOption()
for _, option := range options {
if option.Key == "ModelRatio" {
option.Value = common.AddNewMissingRatio(option.Value)
}
err := updateOptionMap(option.Key, option.Value)
if err != nil {
logger.SysError("failed to update option map: " + err.Error())