修复配置更新错误问题
This commit is contained in:
@@ -56,10 +56,7 @@ func DisableEdgesByMacs(tx *gorm.DB, macs []string) error {
|
||||
|
||||
// 分批处理MAC地址列表
|
||||
for i := 0; i < len(macs); i += batchSize {
|
||||
end := i + batchSize
|
||||
if end > len(macs) {
|
||||
end = len(macs)
|
||||
}
|
||||
end := min(i+batchSize, len(macs))
|
||||
|
||||
batch := macs[i:end]
|
||||
err := tx.Model(&model.Edge{}).Where("macaddr IN ?", batch).Update("active", false).Error
|
||||
|
||||
Reference in New Issue
Block a user