修复配置更新失败问题
This commit is contained in:
@@ -29,6 +29,13 @@ func UpdateConfigs(tx *gorm.DB, configs []model.ConfigUpdate) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 使用事务批量更新配置
|
||||
return tx.Updates(&configs).Error
|
||||
// 批量更新配置
|
||||
for _, config := range configs {
|
||||
err := tx.Updates(&config).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user