From 6353817b4ea7d3670b978327f25ae54ec24e272a Mon Sep 17 00:00:00 2001 From: tangjiawei Date: Thu, 21 Nov 2024 17:54:25 +0800 Subject: [PATCH] =?UTF-8?q?#845=20=E7=9C=8B=E6=9D=BF=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D&=E8=87=AA=E5=AE=9A=E4=B9=89=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=85=8D=E7=BD=AE=E7=BC=96=E8=BE=91=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monitor-server/services/db/custom_dashboard.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor-server/services/db/custom_dashboard.go b/monitor-server/services/db/custom_dashboard.go index 02d85aa79..6f469bd6e 100644 --- a/monitor-server/services/db/custom_dashboard.go +++ b/monitor-server/services/db/custom_dashboard.go @@ -310,9 +310,9 @@ func mergeArray(ids ...[]int) []int { // 创建一个切片来存储重复的元素 var duplicates []int - // 遍历map,找到出现次数大于1的元素 + // 遍历map,找到出现次数大于len(ids)的元素 for id, count := range countMap { - if count > 1 { + if count >= len(ids) { duplicates = append(duplicates, id) } }