mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 07:48:51 +08:00
avoid divided by 0
fix https://github.com/chrislusf/seaweedfs/issues/650
This commit is contained in:
@@ -10,6 +10,9 @@ import (
|
||||
)
|
||||
|
||||
func (v *Volume) garbageLevel() float64 {
|
||||
if v.ContentSize() == 0 {
|
||||
return 0
|
||||
}
|
||||
return float64(v.nm.DeletedSize()) / float64(v.ContentSize())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user