From 88fbe968a6ae000aabd287a6abb33859148b3c52 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Thu, 16 Mar 2023 08:59:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=98=E5=82=A8=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E7=BB=9F=E8=AE=A1=E5=8F=AF=E8=83=BD=E4=B8=BA=E8=B4=9F?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/manager.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/caches/manager.go b/internal/caches/manager.go index 60c0a9a..34d15c7 100644 --- a/internal/caches/manager.go +++ b/internal/caches/manager.go @@ -177,10 +177,15 @@ func (this *Manager) TotalDiskSize() int64 { this.locker.RLock() defer this.locker.RUnlock() - total := int64(0) + var total = int64(0) for _, storage := range this.storageMap { total += storage.TotalDiskSize() } + + if total < 0 { + total = 0 + } + return total }