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

This commit is contained in:
刘祥超
2023-03-16 08:59:35 +08:00
parent 21b770ba8b
commit 495b553285

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
}