修复存储空间统计可能为负值的问题

This commit is contained in:
GoEdgeLab
2023-03-16 08:59:35 +08:00
parent 3239549ce3
commit 88fbe968a6

View File

@@ -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
}