1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-30 06:12:15 +02:00

avoid divided by 0

fix https://github.com/chrislusf/seaweedfs/issues/650
This commit is contained in:
Chris Lu 2018-06-25 01:20:15 -07:00
parent 0d83c1b91e
commit 9bcaa65574

View file

@ -10,6 +10,9 @@ import (
)
func (v *Volume) garbageLevel() float64 {
if v.ContentSize() == 0 {
return 0
}
return float64(v.nm.DeletedSize()) / float64(v.ContentSize())
}