From 9751f43c7a0abcc90220655cf610beaf424af4ab Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 13 Oct 2023 09:22:45 +0800 Subject: [PATCH] =?UTF-8?q?macOS=E4=B8=8A=E6=A3=80=E6=B5=8B=E7=A3=81?= =?UTF-8?q?=E7=9B=98=E6=98=AF=E5=90=A6=E4=B8=8D=E8=B6=B3=E6=97=B6=E5=BF=BD?= =?UTF-8?q?=E7=95=A5/Developer/=E7=9B=B8=E5=85=B3=E5=88=86=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/default/dashboard/dashboardutils/utils.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/web/actions/default/dashboard/dashboardutils/utils.go b/internal/web/actions/default/dashboard/dashboardutils/utils.go index 47b28cd5..55a6a49f 100644 --- a/internal/web/actions/default/dashboard/dashboardutils/utils.go +++ b/internal/web/actions/default/dashboard/dashboardutils/utils.go @@ -19,6 +19,7 @@ import ( "os/exec" "regexp" "runtime" + "strings" ) // CheckDiskPartitions 检查服务器磁盘空间 @@ -47,6 +48,14 @@ func CheckDiskPartitions(thresholdPercent float64) (path string, usage uint64, u if p.Fstype != rootFS { continue } + + // skip some specified partitions on macOS + if runtime.GOOS == "darwin" { + if strings.Contains(p.Mountpoint, "/Developer/") { + continue + } + } + stat, _ := disk.Usage(p.Mountpoint) if stat != nil { if stat.Used < 2*uint64(sizes.G) {